Changed file API to not write response data on a HEAD request

Этот коммит содержится в:
hmhealey
2015-07-29 10:21:31 -04:00
родитель de01a7e679
Коммит 2e5528542d

Просмотреть файл

@@ -261,7 +261,10 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "max-age=2592000, public")
w.Header().Set("Content-Length", strconv.Itoa(len(f)))
w.Write(f)
if r.Method != "HEAD" {
w.Write(f)
}
}
func asyncGetFile(path string, fileData chan []byte) {