From e431d4121e8da8d7fc243b29b780c2cd535a4210 Mon Sep 17 00:00:00 2001 From: chrislusf Date: Mon, 8 Dec 2014 20:34:27 -0800 Subject: [PATCH] Add optional http redirect for filer GET requests. --- go/weed/weed_server/filer_server_handlers.go | 3 ++- 1 file 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 9d8481ac9..6f22912a7 100644 --- a/go/weed/weed_server/filer_server_handlers.go +++ b/go/weed/weed_server/filer_server_handlers.go @@ -83,7 +83,8 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, urlLocation := lookup.Locations[rand.Intn(len(lookup.Locations))].PublicUrl urlString := "http://" + urlLocation + "/" + fileId if fs.redirectOnRead { - + http.Redirect(w, r, urlString, http.StatusFound) + return } u, _ := url.Parse(urlString) request := &http.Request{