Merge pull request #295 from blob8108/xhr-headers

Add useful headers to HTTP block
pull/3/merge
Jens Mönig 2014-01-08 06:34:41 -08:00
commit 82c03bae77
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -1730,6 +1730,9 @@ Process.prototype.reportURL = function (url) {
if (!this.httpRequest) {
this.httpRequest = new XMLHttpRequest();
this.httpRequest.open("GET", 'http://' + url, true);
this.httpRequest.setRequestHeader("X-Requested-With",
"XMLHttpRequest");
this.httpRequest.setRequestHeader("X-Application", "Snap! 4.0");
this.httpRequest.send(null);
} else if (this.httpRequest.readyState === 4) {
response = this.httpRequest.responseText;