diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-10-23 22:11:42 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-10-23 22:11:42 -0700 |
| commit | c358f96aaa9d13703e96b3726c4a52e5841e5b4a (patch) | |
| tree | 7101668c7cd4af75b86af9c7c578e9c98a1b40ed | |
| parent | c0776aa40f5787fa74084744554417a52fdbe26b (diff) | |
| download | seaweedfs-c358f96aaa9d13703e96b3726c4a52e5841e5b4a.tar.xz seaweedfs-c358f96aaa9d13703e96b3726c4a52e5841e5b4a.zip | |
volume: redirection follow public url
fix https://github.com/chrislusf/seaweedfs/issues/1089
| -rw-r--r-- | weed/server/volume_server_handlers_read.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/server/volume_server_handlers_read.go b/weed/server/volume_server_handlers_read.go index f30ffefaf..cd11356b9 100644 --- a/weed/server/volume_server_handlers_read.go +++ b/weed/server/volume_server_handlers_read.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "errors" + "fmt" "io" "mime" "mime/multipart" @@ -66,7 +67,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) glog.V(2).Infoln("volume", volumeId, "found on", lookupResult, "error", err) if err == nil && len(lookupResult.Locations) > 0 { u, _ := url.Parse(util.NormalizeUrl(lookupResult.Locations[0].PublicUrl)) - u.Path = r.URL.Path + u.Path = fmt.Sprintf("%s/%s,%s", u.Path, vid, fid) arg := url.Values{} if c := r.FormValue("collection"); c != "" { arg.Set("collection", c) |
