Simple Empty Content Fix.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
1a48e7815f
commit
59b5d686d4
@ -37,6 +37,7 @@ func ProcessSupportedPreconditionsForNext(rw http.ResponseWriter, req *http.Requ
|
|||||||
}
|
}
|
||||||
if conditionFailed {
|
if conditionFailed {
|
||||||
SwitchToNonCachingHeaders(rw.Header())
|
SwitchToNonCachingHeaders(rw.Header())
|
||||||
|
rw.Header().Del("Content-Type")
|
||||||
rw.Header().Del("Content-Length")
|
rw.Header().Del("Content-Length")
|
||||||
WriteResponseHeaderCanWriteBody(req.Method, rw, http.StatusPreconditionFailed, "")
|
WriteResponseHeaderCanWriteBody(req.Method, rw, http.StatusPreconditionFailed, "")
|
||||||
return false
|
return false
|
||||||
@ -55,6 +56,7 @@ func ProcessSupportedPreconditionsForNext(rw http.ResponseWriter, req *http.Requ
|
|||||||
parse, err := time.Parse(http.TimeFormat, req.Header.Get("If-Unmodified-Since"))
|
parse, err := time.Parse(http.TimeFormat, req.Header.Get("If-Unmodified-Since"))
|
||||||
if err == nil && modT.After(parse) {
|
if err == nil && modT.After(parse) {
|
||||||
SwitchToNonCachingHeaders(rw.Header())
|
SwitchToNonCachingHeaders(rw.Header())
|
||||||
|
rw.Header().Del("Content-Type")
|
||||||
rw.Header().Del("Content-Length")
|
rw.Header().Del("Content-Length")
|
||||||
WriteResponseHeaderCanWriteBody(req.Method, rw, http.StatusPreconditionFailed, "")
|
WriteResponseHeaderCanWriteBody(req.Method, rw, http.StatusPreconditionFailed, "")
|
||||||
return false
|
return false
|
||||||
@ -101,6 +103,7 @@ func ProcessRangePreconditions(maxLength int64, rw http.ResponseWriter, req *htt
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SwitchToNonCachingHeaders(rw.Header())
|
SwitchToNonCachingHeaders(rw.Header())
|
||||||
|
rw.Header().Del("Content-Type")
|
||||||
rw.Header().Del("Content-Length")
|
rw.Header().Del("Content-Length")
|
||||||
rw.Header().Set("Content-Range", "bytes */"+strconv.FormatInt(maxLength, 10))
|
rw.Header().Set("Content-Range", "bytes */"+strconv.FormatInt(maxLength, 10))
|
||||||
WriteResponseHeaderCanWriteBody(req.Method, rw, http.StatusRequestedRangeNotSatisfiable, "")
|
WriteResponseHeaderCanWriteBody(req.Method, rw, http.StatusRequestedRangeNotSatisfiable, "")
|
||||||
|
Loading…
Reference in New Issue
Block a user