-
Notifications
You must be signed in to change notification settings - Fork 25
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
Json matcher doesn't accept correct header #46
Comments
@Philonous As I understand it |
@Philonous if you want to test your current behavior, you can do this with: get "/users" `shouldRespondWith` [json|[{"name":"bob"}]|] {matchHeaders = ["Content-Type" <:> "application/json; charset=utf-8"]} |
@jkarni any opinion on this. Have you had a discussion on what the right thing for |
Servant seems to implement it on purpose to appease other clients (see haskell-servant/servant#849). Also, the JSON rfc remarks that although it isn't defined, it should be ignored by compliant recipients:
So I think this should be fixed here and have implemented a patch: #47 |
I added a lengthy source code comment in 791dcbb that elaborates my view on this matter. |
Fixed. |
Thanks :) |
I'm trying to test a REST api written in servant. To that end I have a test like this:
That test fails with
The actual header is compatible with the required one, so this shouldn't fail.
The text was updated successfully, but these errors were encountered: