hspec / hspec-wai

Helpers to test WAI applications with Hspec
MIT License
64 stars 25 forks source link

Match JSON content type per RFC #38

Closed koterpillar closed 8 years ago

koterpillar commented 8 years ago

Ignore insignificant spaces in Content-Type header when checking for JSON.

Fixes #6.

sol commented 8 years ago

I don't have the resources to take care of this right now.

But if somebody volunteers to do a thorough code review and release a new version then I'm +1 for this change.

Sent from mobile

On 31 Jul 2016, at 7:31 PM, Alexey Kotlyarov notifications@github.com wrote:

Ignore insignificant spaces in Content-Type header when checking for JSON.

Fixes #6.

You can view, comment on, or merge this pull request online at:

https://github.com/hspec/hspec-wai/pull/38

Commit Summary

Allow any number of spaces in the Content-Type header Use http-media to check JSON content type File Changes

M hspec-wai-json/hspec-wai-json.cabal (1) M hspec-wai-json/package.yaml (1) M hspec-wai-json/src/Test/Hspec/Wai/JSON.hs (15) M hspec-wai-json/test/Test/Hspec/Wai/JSONSpec.hs (18) Patch Links:

https://github.com/hspec/hspec-wai/pull/38.patch https://github.com/hspec/hspec-wai/pull/38.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

koterpillar commented 8 years ago

See #40 for the correct behavior (charset is not required at all).