Browse Source

Fix filer proxing http status code

Double quote etag value.
pull/15/head
Chris Lu 11 years ago
parent
commit
ce4acecaa8
  1. 1
      go/weed/weed_server/filer_server_handlers.go
  2. 2
      go/weed/weed_server/volume_server_handlers.go

1
go/weed/weed_server/filer_server_handlers.go

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

2
go/weed/weed_server/volume_server_handlers.go

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

Loading…
Cancel
Save