From 0236efa5e0156a0ab9f4fdf4393eb68de5caea72 Mon Sep 17 00:00:00 2001 From: Jason Barnabe Date: Sat, 1 Dec 2012 17:50:43 -0600 Subject: [PATCH] issue 77 Support long install URLs --- install.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.js b/install.js index c435d214..d44324e4 100644 --- a/install.js +++ b/install.js @@ -41,11 +41,18 @@ function getResource(url, callback) { return; } var xhr = new XMLHttpRequest(); - xhr.open("GET", url, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && callback) { 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(); + } }