issue 77 Support long install URLs
This commit is contained in:
parent
88c3eeaf20
commit
0236efa5e0
11
install.js
11
install.js
|
@ -41,11 +41,18 @@ function getResource(url, callback) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("GET", url, true);
|
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState == 4 && callback) {
|
if (xhr.readyState == 4 && callback) {
|
||||||
callback(xhr.responseText);
|
callback(xhr.responseText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xhr.send();
|
if (url.length > 2000) {
|
||||||
|
var parts = url.split("?");
|
||||||
|
xhr.open("POST", parts[0], true);
|
||||||
|
xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
||||||
|
xhr.send(parts[1]);
|
||||||
|
} else {
|
||||||
|
xhr.open("GET", url, true);
|
||||||
|
xhr.send();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user