TypeError: Cannot read property 'Set-Cookie' of undefined
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 95
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
If I add sesh to the download example from http://stackoverflow.com/questions/7288814/download-file-from-nodejs-server, I get the error below.
The following insertion to the first line of response.js's writeHead function seems to fix the problem:
headers = headers || {};
/Users/paulb/mds110804/node_modules/sesh/node_modules/response/lib/response.js:14
headers[k] = headers[k] || that._additionalHeaders[k];
^
TypeError: Cannot read property 'Set-Cookie' of undefined
at /Users/paulb/mds110804/node_modules/sesh/node_modules/response/lib/response.js:14:33
at Array.forEach (native)
at ServerResponse.writeHead
(/Users/paulb//mds110804/node_modules/sesh/node_modules/response/lib/response.js:13:46)
at ServerResponse._implicitHeader (http.js:797:8)
at ServerResponse.end (http.js:654:10)
at /Users/paulb/mds110804/server/download.js:33:17
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with node_modules/sesh/node_modules/response/lib/response.js, especially ServerResponse.writeHead, and reproduce the download example described in the issue using server/download.js. Confirm that the request completes without a TypeError when writeHead receives no headers and that the existing response behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100