allow https query from locally loaded sources

thanks, Michael, for the hint!
upd4.1
Jens Mönig 2017-09-06 07:55:30 +02:00
rodzic 9f17f34e7c
commit 4b169000b5
2 zmienionych plików z 10 dodań i 9 usunięć

Wyświetl plik

@ -3613,6 +3613,7 @@ Fixes:
170906
------
* Blocks, Threads: added “csv” option to the SPLIT primitive
* Threads: allow https query from locally loaded sources (thanks, Michael, for the hint!)
v4.1 Features:

Wyświetl plik

@ -2265,19 +2265,19 @@ Process.prototype.reportLastAnswer = function () {
// Process URI retrieval (interpolated)
Process.prototype.reportURL = function (url) {
var idx, protocol, hostname, response;
var response;
if (!this.httpRequest) {
// use the location protocol unless the user specifies otherwise
idx = url.indexOf('://');
if (idx < 0) {
protocol = location.protocol + '//';
hostname = url;
} else {
protocol = url.slice(0, idx) + '://';
hostname = url.slice(idx + 3, url.length);
if (url.indexOf('//') < 0) {
if (location.protocol === 'file:') {
// allow requests from locally loaded sources
url = 'https://' + url;
} else {
url = location.protocol + '//' + url;
}
}
this.httpRequest = new XMLHttpRequest();
this.httpRequest.open("GET", protocol + hostname, true);
this.httpRequest.open("GET", url, true);
this.httpRequest.send(null);
} else if (this.httpRequest.readyState === 4) {
response = this.httpRequest.responseText;