Skip to content

Commit

Permalink
fix(response): initialize inner _headers map for node v10.1.0 compati…
Browse files Browse the repository at this point in the history
…bility

Closes #7
  • Loading branch information
antongolub committed May 17, 2018
1 parent ddca097 commit cf19b6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# TODO

* Think about triggering OutgoingMessage constructor setters, which are skipped by Express
https://github.com/apapirovski/node/commit/665bac07857e233c82f6d412b5bef94f0597cb30?diff=split
6 changes: 3 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default class Response implements IResponse {
cookie: ICookieSetter
header: IHeaderSetter
headers: IHeadersMap
_headers: IAny
status: IStatusSetter
app: IApp
req: IRequest | Object
Expand Down Expand Up @@ -83,6 +84,8 @@ export default class Response implements IResponse {
get () { return body },
set (value: IData) { throw new Error('Use .send(), .write() or .json()') }
}: Object))

this._headers = null
this.req = opts.req
this.app = opts.app
this.status(opts.statusCode)
Expand Down

0 comments on commit cf19b6d

Please sign in to comment.