diff --git a/.travis.yml b/.travis.yml index 8023999..2d4ed12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ node_js: - "6" - "8" - "10" + - "12" script: - npm run lint diff --git a/lib/spdy/agent.js b/lib/spdy/agent.js index 4adc524..7f77e24 100644 --- a/lib/spdy/agent.js +++ b/lib/spdy/agent.js @@ -248,7 +248,7 @@ proto._createStream = function _createStream (req, handle) { return state.connection.reserveStream({ method: req.method, path: req.path, - headers: req._headers, + headers: req.getHeaders ? req.getHeaders() : req._headers, host: state.host }, function (err, stream) { if (err) { diff --git a/lib/spdy/response.js b/lib/spdy/response.js index e607918..d951a8d 100644 --- a/lib/spdy/response.js +++ b/lib/spdy/response.js @@ -15,7 +15,8 @@ exports.writeHead = function writeHead (statusCode, reason, obj) { } this.statusCode = statusCode - if (this._headers) { + var resHeaders = this.getHeaders ? this.getHeaders() : this._headers + if (resHeaders) { // Slow-case: when progressive API and header fields are passed. if (obj) { var keys = Object.keys(obj)