Changed file API to not write response data on a HEAD request
Этот коммит содержится в:
@@ -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("Cache-Control", "max-age=2592000, public")
|
||||||
w.Header().Set("Content-Length", strconv.Itoa(len(f)))
|
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) {
|
func asyncGetFile(path string, fileData chan []byte) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user