Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change error responses from plain text to JSON #4845

Merged
merged 4 commits into from
Dec 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! Return 404 Not Found responses as JSON
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
  • Loading branch information
chaudum committed Dec 2, 2021
commit c14902cc64bca306ca5f0e9e210752484309bf08
2 changes: 1 addition & 1 deletion pkg/util/server/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type ErrorResponseBody struct {
}

func NotFoundHandler(w http.ResponseWriter, r *http.Request) {
JSONError(w, 404, "page not found")
JSONError(w, 404, "not found")
}

func JSONError(w http.ResponseWriter, code int, message string, args ...interface{}) {
Expand Down