cleanup
This commit is contained in:
		
							parent
							
								
									0cc4a8a92f
								
							
						
					
					
						commit
						fb405dc55c
					
				
							
								
								
									
										15
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								main.go
									
									
									
									
									
								
							@ -183,21 +183,12 @@ func handleDownload(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ctx.DownloadURL = downloadURL
 | 
			
		||||
    w.Header().Add(
 | 
			
		||||
        "Hx-Redirect", 
 | 
			
		||||
        fmt.Sprintf("/download-direct?URL=%s&filename=%s",
 | 
			
		||||
    ctx.DownloadURL = fmt.Sprintf("/download-direct?URL=%s&filename=%s",
 | 
			
		||||
        url.QueryEscape(ctx.DownloadURL), 
 | 
			
		||||
        url.QueryEscape(filename)),
 | 
			
		||||
        url.QueryEscape(filename),
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    err = templates.ExecuteTemplate(w,"download-result.html", ctx)
 | 
			
		||||
    if err != nil {
 | 
			
		||||
        log.Println(err.Error())
 | 
			
		||||
        ctx.StatusCode = 500
 | 
			
		||||
        ctx.Err = &err
 | 
			
		||||
        err = templates.ExecuteTemplate(w,"download-result.html", ctx)
 | 
			
		||||
        return
 | 
			
		||||
    }
 | 
			
		||||
    w.Header().Add("Hx-Redirect", ctx.DownloadURL)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func handleDirectDownload(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user