Skip to content

Commit

Permalink
fix: add admin check for topic/node thombstone endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dudleycarr committed Sep 28, 2023
1 parent 51b270f commit 5379bf4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nsqadmin/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"time"

"github.com/julienschmidt/httprouter"

"github.com/nsqio/nsq/internal/clusterinfo"
"github.com/nsqio/nsq/internal/http_api"
"github.com/nsqio/nsq/internal/lg"
Expand Down Expand Up @@ -408,6 +409,10 @@ func (s *httpServer) nodeHandler(w http.ResponseWriter, req *http.Request, ps ht
func (s *httpServer) tombstoneNodeForTopicHandler(w http.ResponseWriter, req *http.Request, ps httprouter.Params) (interface{}, error) {
var messages []string

if !s.isAuthorizedAdminRequest(req) {
return nil, http_api.Err{403, "FORBIDDEN"}
}

node := ps.ByName("node")

var body struct {
Expand Down

0 comments on commit 5379bf4

Please sign in to comment.