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

Edge API requests return 502 in response to invalid JSON #3787

Open
1 of 4 tasks
rolodato opened this issue Apr 17, 2024 · 2 comments
Open
1 of 4 tasks

Edge API requests return 502 in response to invalid JSON #3787

rolodato opened this issue Apr 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rolodato
Copy link
Contributor

How are you running Flagsmith

  • Self Hosted with Docker
  • Self Hosted with Kubernetes
  • SaaS at flagsmith.com
  • Some other way (add details in description below)

Describe the bug

Requests to the Edge API with invalid JSON payloads return 502 instead of 400 like the Core API does. This can make it seem like a problem with our API when it's not.

Steps To Reproduce

POST invalid JSON to any Edge API endpoint, get 502 in response:

curl -i -X POST 'https://edge.api.flagsmith.com/api/v1/identities' -H 'Content-Type: application/json' -H 'X-Environment-Key: 123' -d '}{'

HTTP/2 502
server: awselb/2.0
date: Wed, 17 Apr 2024 14:42:10 GMT
content-type: text/html
content-length: 122

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>

Expected behavior

Any requests made with invalid JSON should return 400 and not 502.

Screenshots

No response

@rolodato rolodato added the bug Something isn't working label Apr 17, 2024
@RafaelJohn9
Copy link

may I be assigned this issue

@dabeeeenster
Copy link
Contributor

This code isn't open source yet!

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

No branches or pull requests

3 participants