hspec / hspec-wai

Helpers to test WAI applications with Hspec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

For JSON response matcher, spaces in Content-Type header don't matter

koterpillar opened this issue · comments

According to RFC 2045, spaces aren't required in Content-Type: application/json; charset=utf-8 - there can be any number of them after the semicolon, including zero. This should be taken into account for the JSON response matcher, as the following headers are valid:

Content-Type: application/json;charset=utf-8 (note that http-media produces this)

Content-Type: application/json; charset=utf-8

+1

Sent from mobile

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

According to RFC 2045, spaces aren't required in Content-Type: application/json; charset=utf-8 - there can be any number of them after the semicolon, including zero. This should be taken into account for the JSON response matcher, as the following headers are valid:

Content-Type: application/json;charset=utf-8 (note that http-media produces this)

Content-Type: application/json; charset=utf-8


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

While this is still valid, see #39 for the correct behavior.