diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-08-26 09:51:38 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-08-26 09:51:38 -0400 |
commit | 531d9f2a01598e1952e77bfaa156a0b0de7b74a3 (patch) | |
tree | 95d988bc0606848ed47de26f244723ad88165f09 /lib/js | |
parent | f9bd509b7bf2ccb36e84e0f93702f8a05f7d7294 (diff) |
Gracefully accept browser's refusal to let us set certain AJAX headers
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 6 |
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()); |