mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-30 07:09:01 +08:00
Add optional http redirect for filer GET requests.
This commit is contained in:
parent
124c232a3b
commit
e431d4121e
@ -83,7 +83,8 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
|||||||
urlLocation := lookup.Locations[rand.Intn(len(lookup.Locations))].PublicUrl
|
urlLocation := lookup.Locations[rand.Intn(len(lookup.Locations))].PublicUrl
|
||||||
urlString := "http://" + urlLocation + "/" + fileId
|
urlString := "http://" + urlLocation + "/" + fileId
|
||||||
if fs.redirectOnRead {
|
if fs.redirectOnRead {
|
||||||
|
http.Redirect(w, r, urlString, http.StatusFound)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
u, _ := url.Parse(urlString)
|
u, _ := url.Parse(urlString)
|
||||||
request := &http.Request{
|
request := &http.Request{
|
||||||
|
Loading…
Reference in New Issue
Block a user