exceptionless / Exceptionless.JavaScript

Exceptionless JavaScript client
http://exceptionless.com
Apache License 2.0
59 stars 24 forks source link

Microsoft IE/Edge doesn't seem to be pulling down client configuration settings. #23

Closed niemyjski closed 8 years ago

niemyjski commented 9 years ago

I noticed this during testing that it doesn't seem to be parsing the header properly.

srijken commented 8 years ago

Also seen in IE11, didn't check older browsers.

The reason here is that XHR.getAllResponseHeaders() returns a string that doesn't confirm to the specification. The string returned in the error instance:

\nX-Exceptionless-ConfigVersion: 10\r\nX-RateLimit-Limit: 3500\r\nX-RateLimit-Remaining: 3483\r\n\r\n

The problem that causes the issue in Exceptionless.Javascript is the fact that the result of getAllResponseHeaders() starts of with '\n. That in turn causes the header to be stored like this:

headers['\nX-Exceptionless-ConfigVersion'] = 10;

Because the value is read with the extra \n, the current configVersion can't be read, and that causes the config API endpoint to never be called.

Fix is to trim the keys when we assign values to the object property.

Although the leading \n causes the problem, the trailing \r\n\r\n shouldn't be there either according to the specification

niemyjski commented 8 years ago

Logged as a bug here: https://connect.microsoft.com/IE/feedbackdetail/view/1929694/ie-edge-incorrectly-return-the-header-with-a-leading-new-line-character