-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Lucky does not handle Accept header properly #1766
Comments
In your point 2, adding But I do think there may be some issues around using |
Ahh yes, perhaps I wasn't clear. The Stripe API is completely JSON based, at least that's what is documented. There's no XML involved in what I'm doing. I'm not sure why their request indicates they accept XML. |
I'd be curious to know... is that a bug in their postback API? That seems pretty strange if it's a JSON API, but their API sends an Accept header with "application/xml" in it 😂 maybe it's meant to be a fallback? 🤷♂️ |
Weirdly enough it was reported and apparently fixed in July but appears to have returned... stripe/stripe-cli#909 |
Describe the bug
Lucky incorrectly rejects a request as not acceptable, even thought the
Accept
header has a*/*
entry.To Reproduce
ApiAction
Accept
header with this value:*/*; q=0.5, application/xml
Expected behavior
The request is handled.
Actual behaviour
The request is rejected with status 406 Not Acceptable. The error indicates that the client wants XML so this should be added to the accepted formats. However, this is not true the
*/*
entry means the client accepts anything, including the configured format,:json
.Versions (please complete the following information):
crystal --version
): Crystal 1.6.2Additional context
:xml
toaccepted_formats
allows working around the issue, but should not be necessaryThe text was updated successfully, but these errors were encountered: