diff --git a/lib/Request.js b/lib/Request.js index 03f18eb2d6f..f8797a9dcba 100644 --- a/lib/Request.js +++ b/lib/Request.js @@ -71,10 +71,13 @@ class Request { } /** - * @param {!Object} headers + * @param {string} key + * @param {string} value */ - setHeaders(headers) { - this._headersOverride = headers; + setHeader(key, value) { + if (!this._headersOverride) + this._headersOverride = Object.assign({}, this._headers); + this._headersOverride[key] = value; } /** diff --git a/third_party/phantomjs/test/module/webpage/add-header.js b/third_party/phantomjs/test/module/webpage/add-header.js index 5594f4e2834..46b70bb1b0e 100644 --- a/third_party/phantomjs/test/module/webpage/add-header.js +++ b/third_party/phantomjs/test/module/webpage/add-header.js @@ -1,4 +1,3 @@ -//! unsupported async_test(function () { var webpage = require('webpage');