mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-24 21:37:26 +08:00
Add optional http redirect for filer GET requests.
This commit is contained in:
@@ -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{
|
||||||
|
Reference in New Issue
Block a user