node-XMLHttpRequest
node-XMLHttpRequest copied to clipboard
Sync requests via jQuery fail
I tried making a sync request via jQuery through node-XMLHttpRequest. It threw a not-all-that-obvious error. I traced through the code, and found it was due to jQuery calling xhr.getAllResponseHeaders(). It appears that for the sync case node-xhr doesn't support getAllResponseHeaders. Specifically the current impl goes to the response object to get the headers, but the response object is defined because in the sync case there isn't one.
Thanks. You're right, looks like sync requests don't set the response headers. I will work on this for the next release.
I've just issued a PR that provides a work-around for this, and also for the "getAllResponseHeaders" part of #47 (Cannot read property 'headers' of undefined in XMLHttpRequest.js).