Skip to content

Commit 68d227e

Browse files
authored
Merge pull request #153 from aursaty/fix/change_prefix_for_admin_routes_remove_and_allow
Fix bug in handler for admin routes for remove and allow nodes.
2 parents 1741b6c + 04d406a commit 68d227e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

admin/cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (h *AdminHandlers) handleClusterReplication(w http.ResponseWriter, r *http.
162162

163163
// handleClusterRemove handles POST /admin/cluster/remove/{node_id}
164164
func (h *AdminHandlers) handleClusterRemove(w http.ResponseWriter, r *http.Request) {
165-
path := strings.TrimPrefix(r.URL.Path, "/admin/cluster/remove/")
165+
path := strings.TrimPrefix(r.URL.Path, "/cluster/remove/")
166166
nodeID, err := parsePeerNodeID(path)
167167
if err != nil {
168168
writeErrorResponse(w, http.StatusBadRequest, err.Error())
@@ -185,7 +185,7 @@ func (h *AdminHandlers) handleClusterRemove(w http.ResponseWriter, r *http.Reque
185185

186186
// handleClusterAllow handles POST /admin/cluster/allow/{node_id}
187187
func (h *AdminHandlers) handleClusterAllow(w http.ResponseWriter, r *http.Request) {
188-
path := strings.TrimPrefix(r.URL.Path, "/admin/cluster/allow/")
188+
path := strings.TrimPrefix(r.URL.Path, "/cluster/allow/")
189189
nodeID, err := parsePeerNodeID(path)
190190
if err != nil {
191191
writeErrorResponse(w, http.StatusBadRequest, err.Error())

0 commit comments

Comments
 (0)