webmock
webmock copied to clipboard
`json_headers?` doesn't match when charset is specified in `Content-Type` header
When using the HTTP gem with a command like HTTP.post(url, json: { a: 1 }), the Content-Type-header is set to application/json; charset=UTF-8. This currently prevents me from using the RequestBodyDiff-method, as a check for json_headers? is made, which returns false if the content type isn't exactly application/json.
Specifying the charset in the content type should be allowed. So json_headers? should only check whether the content type starts with application/json, instead of requiring an exact match.
There is an open PR #969 that fixes this.