[api] use object instead of map for headers (#567)

This patch:

- switches to objects instead of maps for headers (in Request, Response and
page.setExtraHTTPHeaders)
- converts all header names to lower case

Fixes #547, fixes #509
This commit is contained in:
Andrey Lushnikov
2017-08-28 12:09:24 -07:00
committed by GitHub
parent 39b9081747
commit 66912a7277
5 changed files with 30 additions and 38 deletions

View File

@@ -218,9 +218,4 @@ class Helper {
}
}
// Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
if (!Object.entries)
Object.entries = obj => Object.keys(obj).map(key => [key, obj[key]]);
module.exports = Helper;