Skip to content
Snippets Groups Projects
Commit 1fbeefcc authored by Jacob Vosmaer's avatar Jacob Vosmaer
Browse files

Remove some comments

parent 29e0408c
No related branches found
No related tags found
1 merge request!18Remove custom ResponseWriter duplication
Pipeline #
Loading
Loading
@@ -16,16 +16,13 @@ func newSendFileResponseModifier(rw http.ResponseWriter, req *http.Request) *res
m := &responseModifier{rw: rw}
 
m.wantModify = func() bool {
// Check X-Sendfile header
file = m.Header().Get("X-Sendfile")
m.Header().Del("X-Sendfile")
 
// If file is empty or status is not 200 pass through header
return file != "" && m.status == http.StatusOK
}
 
m.modify = func() {
// Serve the file
log.Printf("Send file %q for %s %q", file, req.Method, req.RequestURI)
content, fi, err := openFile(file)
if err != nil {
Loading
Loading
@@ -35,7 +32,6 @@ func newSendFileResponseModifier(rw http.ResponseWriter, req *http.Request) *res
defer content.Close()
 
http.ServeContent(m.rw, req, "", fi.ModTime(), content)
}
 
req.Header.Set("X-Sendfile-Type", "X-Sendfile")
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment