Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

jsdom XMLHttpRequest reports no headers #119

Open
justincy opened this issue Aug 15, 2016 · 0 comments
Open

jsdom XMLHttpRequest reports no headers #119

justincy opened this issue Aug 15, 2016 · 0 comments

Comments

@justincy
Copy link

jsdom expects rawHeaders to be available. They are being generated internally but just not passed on. This can be fixed by adding rawHeaders: response.rawHeaders || [] to this block of code:

this.response = {
version: response.version || '1.1',
statusCode: response.statusCode && parseInt(response.statusCode, 10) || 200,
statusMessage: response.statusMessage || '',
headers: {},
body: response.body ? response.body.slice(0) : [],
trailers: {}
};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant