1
0

Added special case for curl in NotFound handler.

This commit is contained in:
Alexander Andreev 2022-07-01 03:31:08 +04:00
parent 14e0886790
commit 023fdab96f
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -182,5 +182,9 @@ func (h *UploadHandlers) Download(w http.ResponseWriter, r *http.Request) {
func (h *UploadHandlers) NotFound(w http.ResponseWriter, r *http.Request) { func (h *UploadHandlers) NotFound(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound) w.WriteHeader(http.StatusNotFound)
if !strings.Contains(r.UserAgent(), "curl") {
web.Error404(utils.MainSite(r.Host), w) web.Error404(utils.MainSite(r.Host), w)
} else {
fmt.Fprintln(w, "deleted")
}
} }