From ce4acecaa8fa9461cbfae1fadea5b320161d2acd Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 25 Aug 2014 12:02:04 -0700 Subject: [PATCH] Fix filer proxing http status code Double quote etag value. --- go/weed/weed_server/filer_server_handlers.go | 1 + go/weed/weed_server/volume_server_handlers.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go/weed/weed_server/filer_server_handlers.go b/go/weed/weed_server/filer_server_handlers.go index ab30aaaed..0f83352a9 100644 --- a/go/weed/weed_server/filer_server_handlers.go +++ b/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 { w.Header()[k] = v } + w.WriteHeader(resp.StatusCode) io.Copy(w, resp.Body) } diff --git a/go/weed/weed_server/volume_server_handlers.go b/go/weed/weed_server/volume_server_handlers.go index eed198e4a..e7571ccc7 100644 --- a/go/weed/weed_server/volume_server_handlers.go +++ b/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) return } - w.Header().Set("Etag", etag) + w.Header().Set("Etag", "\""+etag+"\"") if n.NameSize > 0 && filename == "" { filename = string(n.Name) dotIndex := strings.LastIndex(filename, ".")