Sync requests via jQuery fail #27

Open
kevindente opened this Issue Mar 23, 2012 · 2 comments

Comments

Projects
None yet
3 participants

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.

Owner

driverdan commented Jun 1, 2012

Thanks. You're right, looks like sync requests don't set the response headers. I will work on this for the next release.

@jjbenson jjbenson added a commit to jjbenson/node-XMLHttpRequest that referenced this issue Feb 23, 2015

@jjbenson jjbenson Trap for missing response/response headers in getAllResponseHeaders (…
…fix for #27).
cfcd5a2

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment