Add optional http redirect for filer GET requests.

This commit is contained in:
chrislusf 2014-12-08 20:34:27 -08:00
parent 124c232a3b
commit e431d4121e

View File

@ -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{