Fix filer proxing http status code

Double quote etag value.
This commit is contained in:
Chris Lu 2014-08-25 12:02:04 -07:00
parent 4c58cef24a
commit ce4acecaa8
2 changed files with 2 additions and 1 deletions

View file

@ -103,6 +103,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
for k, v := range resp.Header {
w.Header()[k] = v
}
w.WriteHeader(resp.StatusCode)
io.Copy(w, resp.Body)
}

View file

@ -95,7 +95,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
w.WriteHeader(http.StatusNotModified)
return
}
w.Header().Set("Etag", etag)
w.Header().Set("Etag", "\""+etag+"\"")
if n.NameSize > 0 && filename == "" {
filename = string(n.Name)
dotIndex := strings.LastIndex(filename, ".")