bhollis/jsonview

Headers should be processed as case-insensitive

Closed this issue · 4 comments

I have ran into issue that nginx send lower case content-type header, which causes Jsonview to ignore the json response because the detectJson function works in a case-sensitive manner:

if (header.name === "Content-Type" && header.value && jsonContentType.test(header.value)) {

This should be changed to to case-insensitive, because it stated so by the standard and because Google and CloudFlare use the SPDY protocol (next to HTTP) which explicitly requires lower case headers.

Thanks, you're right. I'll make this change.

dmick commented

I just ran into this as well (with JSON responses from elasticsearch)

JSONView 2.1.0 has been uploaded to the Chrome and Firefox extension repos and includes a fix. It should be available soon.

dmick commented

Thanks Ben!