Skip to content

Conversation

@AditSoni
Copy link

Replaced 403 status code with 401 ; as 403 represents correct authentication but incorrect authorization.

And the cases here are about missing creds in auth headers so 401 makes more sense.

The response body is displaying the correct message but the response status code was 403.

AditSoni and others added 3 commits May 22, 2025 16:58
…reds

Replaced 403 status code with 401 ; as 403 represents correct authentication but incorrect authorization. 

And the cases here are about missing creds in auth headers so 401 makes more sense. 

The response body is displaying the correct message but the response status code was 403.
@AditSoni AditSoni changed the title Updated http.py: Fixed response status code in case of missing auth creds. Bug: Fixed response status code which were misconfigured to show 403 May 22, 2025
@mkbhanda
Copy link

Looks good.

A better practice is to use constants everywhere exceptions are created and asserts like HTTP_401_UNAUTHORIZED and INVALID_AUTH_CREDENTIALS_STR to avoid errors from typos.

@svlandeg svlandeg changed the title Bug: Fixed response status code which were misconfigured to show 403 🐛 Fix response status code which were misconfigured to show 403 Jun 23, 2025
@svlandeg svlandeg added the bug Something isn't working label Aug 27, 2025
@svlandeg
Copy link
Member

Thanks for the contribution @AditSoni 🙏. I'm closing this one in favour of #13786, which is more extensive and should (hopefully) address this issue once and for all.

@svlandeg svlandeg closed this Oct 21, 2025
@njsbhu

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants