Added special case for curl in NotFound handler.
This commit is contained in:
parent
14e0886790
commit
023fdab96f
@ -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")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user