Skip to content

Commit

Permalink
Use static 404 for unsupported signalfx-forwarder paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Fitzpatrick committed Apr 22, 2021
1 parent 90e959e commit 6bfde65
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/monitors/forwarder/forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ func setupHandler(ctx context.Context, router *mux.Router, chainType string, sin
}

func notFoundHandler(w http.ResponseWriter, r *http.Request) {
errMsg := fmt.Sprintf("Datapoint or span request received on invalid path '%s'. "+
"You should send to the same path that you would on the Smart Gateway.", r.URL.Path)
logger.ThrottledError(errMsg)
_, _ = w.Write([]byte(errMsg + "\n"))
errMsg := "Datapoint or span request received on invalid path"
logger.ThrottledError(fmt.Sprintf("%s: %s", errMsg, r.URL.Path))
errMsg = fmt.Sprintf("%s. You should send to the same path that you would on the Smart Gateway.\n", errMsg)
w.WriteHeader(404)
_, _ = w.Write([]byte(errMsg))
}

0 comments on commit 6bfde65

Please sign in to comment.