Fix node6 support for Object.entries and URL object (#548)

This patch introduces a polyfill for Object.entries which is missing in Node 6
This commit is contained in:
JoelEinbinder
2017-08-25 15:13:59 -07:00
committed by Andrey Lushnikov
parent 4e3b6a1f57
commit 2c4dfbfd88
5 changed files with 18 additions and 7 deletions

View File

@@ -16,7 +16,7 @@
const EventEmitter = require('events');
const helper = require('./helper');
const Multimap = require('./Multimap');
const {URL} = require('url');
const url = require('url');
class NetworkManager extends EventEmitter {
/**
@@ -356,13 +356,13 @@ function generateRequestHash(request) {
}
/**
* @param {string} url
* @param {string} urlString
* @return {string}
*/
function removeURLHash(url) {
const urlObject = new URL(url);
function removeURLHash(urlString) {
const urlObject = url.parse(urlString);
urlObject.hash = '';
return urlObject.toString();
return url.format(urlObject);
}
NetworkManager.Events = {