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

feat: Update HTTP status codes for unauthorized requests #99

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

Keloran
Copy link
Contributor

@Keloran Keloran commented Mar 4, 2025

The changes update the HTTP status codes returned when a user is unauthorized to perform an action. Previously, the code was returning a 500 Internal Server Error, which is not the correct response for an unauthorized request. The changes update the status codes to 401 Unauthorized, which is the appropriate response for an unauthorized request.

The changes were made to the following files:

  • internal/company/http.go
  • internal/secretmenu/http.go
  • internal/project/http.go
  • internal/agent/http.go
  • internal/user/http.go
  • internal/environment/http.go

This ensures that the API is returning the correct HTTP status codes for unauthorized requests, which is important for client-side error handling and debugging.

The changes update the HTTP status codes returned when a user is unauthorized to perform an action. Previously, the code was returning a 500 Internal Server Error, which is not the correct response for an unauthorized request. The changes update the status codes to 401 Unauthorized, which is the appropriate response for an unauthorized request.

The changes were made to the following files:

- `internal/company/http.go`
- `internal/secretmenu/http.go`
- `internal/project/http.go`
- `internal/agent/http.go`
- `internal/user/http.go`
- `internal/environment/http.go`

This ensures that the API is returning the correct HTTP status codes for unauthorized requests, which is important for client-side error handling and debugging.
Copy link

github-actions bot commented Mar 4, 2025

Qodana for Go

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@Keloran Keloran merged commit d2dc817 into main Mar 4, 2025
6 checks passed
@Keloran Keloran deleted the k-branch-1 branch March 4, 2025 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant