diff options
| author | Chris Lu <chris.lu@gmail.com> | 2016-05-23 10:13:01 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2016-05-23 10:13:01 -0700 |
| commit | dfde029430fabd7fc29b8e4f61d1e80b64d6a4de (patch) | |
| tree | 30666acfe8c2e1295843ec45000207c1d6d0d97d /go | |
| parent | 4734efa9a160101988cb8d36c21ddc1eedff7ad8 (diff) | |
| parent | db1ac7b3ebac5a9b71ad829465765d628b8a0197 (diff) | |
| download | seaweedfs-dfde029430fabd7fc29b8e4f61d1e80b64d6a4de.tar.xz seaweedfs-dfde029430fabd7fc29b8e4f61d1e80b64d6a4de.zip | |
Merge pull request #306 from hankya/master
master: redirect handler accept collection parameter
Diffstat (limited to 'go')
| -rw-r--r-- | go/weed/weed_server/master_server_handlers_admin.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/go/weed/weed_server/master_server_handlers_admin.go b/go/weed/weed_server/master_server_handlers_admin.go index 2b6ca0320..383456356 100644 --- a/go/weed/weed_server/master_server_handlers_admin.go +++ b/go/weed/weed_server/master_server_handlers_admin.go @@ -121,7 +121,8 @@ func (ms *MasterServer) redirectHandler(w http.ResponseWriter, r *http.Request) debug("parsing error:", err, r.URL.Path) return } - machines := ms.Topo.Lookup("", volumeId) + collection := r.FormValue("collection") + machines := ms.Topo.Lookup(collection, volumeId) if machines != nil && len(machines) > 0 { var url string if r.URL.RawQuery != "" { @@ -131,7 +132,7 @@ func (ms *MasterServer) redirectHandler(w http.ResponseWriter, r *http.Request) } http.Redirect(w, r, url, http.StatusMovedPermanently) } else { - writeJsonError(w, r, http.StatusNotFound, fmt.Errorf("volume id %d not found", volumeId)) + writeJsonError(w, r, http.StatusNotFound, fmt.Errorf("volume id %d or collection %s not found", volumeId, collection)) } } |
