Replace 500 with 404 and Don't return body for HEAD request

This commit is contained in:
Naren Venkataraman 2014-01-24 01:00:50 -05:00
parent 35811f77b4
commit 28d0e25dbf
1 changed files with 2 additions and 1 deletions

View File

@ -167,7 +167,8 @@ func (h *Handler) patchFile(w http.ResponseWriter, r *http.Request, id string) {
func (h *Handler) headFile(w http.ResponseWriter, r *http.Request, id string) {
info, err := h.store.GetInfo(id)
if err != nil {
h.err(err, w, http.StatusInternalServerError)
w.Header().Set("Content-Length", "0")
w.WriteHeader(http.StatusNotFound)
return
}