Skip to content

Commit

Permalink
fix: temporary HTTP2 fix until <nodejs/node#30894> and <#133> are fur…
Browse files Browse the repository at this point in the history
…ther investigated
  • Loading branch information
niftylettuce committed Dec 11, 2019
1 parent 05da578 commit 24afa7a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,19 @@ module.exports = function(...args) {
// and so we need `parse-request` to parse the `responseHeaders`
// as a String using `http-headers`...
// <https://github.com/nodejs/node/issues/28302>
{ responseHeaders: res._header },
//
// note that HTTP2 responses do not have a String value
// for `res._header`, and instad is a Boolean value
// <https://github.com/nodejs/node/issues/30894>
// <https://github.com/cabinjs/cabin/issues/133>
{
responseHeaders:
typeof res._header === 'string'
? res._header
: typeof res.getHeaders === 'function'
? res.getHeaders()
: null
},
this.config.parseRequest
)
)
Expand Down

0 comments on commit 24afa7a

Please sign in to comment.