Fix reportURL for URLs that have // in the middle

Reported by @brianharvey.

When using proxies we often embed "https://" right in the middle of the URL. The reportURL block was mistakenly thinking that the protocol had already been added to the URL, thus trying to access a relative path.
upd4.1
Bernat Romagosa 2017-10-20 09:19:17 +02:00 zatwierdzone przez GitHub
rodzic 93d96140ca
commit 6f17dab0ef
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -2270,7 +2270,7 @@ Process.prototype.reportURL = function (url) {
var response;
if (!this.httpRequest) {
// use the location protocol unless the user specifies otherwise
if (url.indexOf('//') < 0) {
if (url.indexOf('//') < 0 || url.indexOf('//') > 8) {
if (location.protocol === 'file:') {
// allow requests from locally loaded sources
url = 'https://' + url;