summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-08-26 09:51:38 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-08-26 09:51:38 -0400
commita118306d4028d487136aeec92e4c328b1d8f695b (patch)
tree95d988bc0606848ed47de26f244723ad88165f09 /lib
parent51e517f30a3ef9fafa064f3fb5dd98f842b5c4ad (diff)
Gracefully accept browser's refusal to let us set certain AJAX headers
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 77fc5d79..f0d9b693 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -772,8 +772,10 @@ function requestUri(xhr, uri, needsSig) {
xhr.open("POST", uri, true);
xhr.setRequestHeader("Content-type", "text/plain");
- xhr.setRequestHeader("Content-length", "0");
- xhr.setRequestHeader("Connection", "close");
+ try {
+ xhr.setRequestHeader("Content-length", "0");
+ xhr.setRequestHeader("Connection", "close");
+ } catch (e) { }
if (client_id != null) {
xhr.setRequestHeader("UrWeb-Client", client_id.toString());