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 400 to 401 for invalid creds #240

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
2 changes: 1 addition & 1 deletion v2/basculehttp/frontDoor.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (fd *frontDoor) handleMissingCredentials(response http.ResponseWriter, err

func (fd *frontDoor) handleInvalidCredentials(response http.ResponseWriter, err *bascule.InvalidCredentialsError) {
response.Header().Set("Content-Type", "text/plain")
response.WriteHeader(http.StatusBadRequest)
response.WriteHeader(http.StatusUnauthorized)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's handling credentials that were misformatted or unparseable. That's definitely a bad request, since authentication hasn't even been done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, I thought anything invalid (like misformatted and unparseable) regarding creds would be consider a 401.

response.Write([]byte(err.Error()))
}

Expand Down
Loading