Closed tu1ly closed 11 years ago
i have similar problem
Hi,
I finally manage to replicate it and it was probably caused by the Content-Type
header with value containing semicolon (;
) and additional information about character set e.g.:
Content-Type: application/json; charset=utf-8
Gavel was setting the JSON validator only for exact match with application/json
. Now it takes the semicolon into the game, so it should work as we expect.
Adam
Well actually, application/json; charset=utf-8
is not a valid JSON MIME, see http://lucumr.pocoo.org/2013/7/19/application-mimetypes-and-encodings/
@netmilk but maybe it wouldn't be a bad idea to utilise https://github.com/broofa/node-mime
getting "No validator found for real data media type "NaN" and expected data media type "NaN"". error in results when "Unknown real body media type. Content-type header is "application/json" but body is not a parseble JSON."