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

fix: invalid response type on post request #15609

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Conversation

pb82
Copy link
Contributor

@pb82 pb82 commented Oct 31, 2024

SUMMARY

Fix the 500 response when sending an unauthenticated POST request to /api/controller/login. Using a django JsonResponse avoids the error.

Verified by running this on OpenShift with Gateway.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API
AWX VERSION
2.5
ADDITIONAL INFORMATION

Copy link
Member

@relrod relrod left a comment

Choose a reason for hiding this comment

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

Approving, but: @AlanCoding might know if there's a more DRF-ey way to do this with @api_view or the like. But this looks simple enough to me and fixes the fatal.

@relrod relrod self-requested a review October 31, 2024 13:44
@relrod
Copy link
Member

relrod commented Oct 31, 2024

Actually: It might be nice to have a regression test for this (just mocking out is_proxied_request and calling the endpoint)

@pb82
Copy link
Contributor Author

pb82 commented Oct 31, 2024

@relrod I'm working on a test for this 👍

Copy link
Member

@djyasin djyasin left a comment

Choose a reason for hiding this comment

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

Approving current changes- I wasn't sure if the test work was happening elsewhere.

@PabloHiro
Copy link
Contributor

Would add tests for this one, feels self-contained enough 🙏

@pb82
Copy link
Contributor Author

pb82 commented Nov 12, 2024

@djyasin @PabloHiro thanks, I'll add the tests in this PR

Copy link

sonarcloud bot commented Nov 14, 2024

@pb82 pb82 merged commit 5448757 into ansible:devel Nov 14, 2024
25 checks passed
@pb82 pb82 deleted the AAP-33911 branch November 14, 2024 11:58
@pb82 pb82 restored the AAP-33911 branch November 14, 2024 11:58
@pb82 pb82 deleted the AAP-33911 branch November 14, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants