1
Vote

Inconsistent header field names problem in OS X Safari

description

Hi guys,

I found a little issue on OS X Safari, you can find the details including a solution about it here: http://www.nabisoft.com/tutorials/javascript/resolving-datajs-response-header-access-errors-for-safari-on-mac-os-x

To make it short: in line 2581 there is a missing call of normalizeHeaders(headers);

This leads to the fact that in OS X Safari you have to access the response header with response.headers['Content-Type'] while you have to use response.headers['content-type'] for other browsers. It seems that Safari changes standard HTTP headers, i.e. 'content-type' is changed to 'Content-Type' even though the server sends all lower-case headers (I guess this is for a better human readability).

Please also have a look at the learnings of my tutorial. I am not sure if it's a good approach to pass headers via arrays, however, I am sure there was a good reason for that...

Best,
Nabi

ps Thanks for the great work on datajs!!!

comments