Skip to content

TypeError: Cannot read property 'Set-Cookie' of undefined #8

Open
@paulb777

Description

@paulb777

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions