6279: Do not set content-length headers in XHR.
authorTom Clegg <tom@curoverse.com>
Fri, 10 Jul 2015 15:18:46 +0000 (11:18 -0400)
committerTom Clegg <tom@curoverse.com>
Fri, 10 Jul 2015 15:18:46 +0000 (11:18 -0400)
According to error messages in Chrome console:

Refused to set unsafe header "Content-Length"
  ShellInABox.sendRequest @ shell_in_a_box.js:178
  ShellInABox.onReadyStateChange @ shell_in_a_box.js:206
  (anonymous function) @ shell_in_a_box.js:183

apps/workbench/public/webshell/shell_in_a_box.js

index 448bfda59a7f8518507e142e862b57fe0098aafe..6fdf10d7215491d58a64c6176860e26adfbca15c 100644 (file)
@@ -175,7 +175,6 @@ ShellInABox.prototype.sendRequest = function(request) {
                                (this.session ? '&session=' +
                                 encodeURIComponent(this.session) : '&rooturl='+
                                 encodeURIComponent(this.rooturl));
-  request.setRequestHeader('Content-Length', content.length);
 
   request.onreadystatechange = function(shellInABox) {
     return function() {
@@ -233,7 +232,6 @@ ShellInABox.prototype.sendKeys = function(keys) {
                                  '&height=' + this.terminalHeight +
                                  '&session=' +encodeURIComponent(this.session)+
                                  '&keys=' + encodeURIComponent(keys);
-    request.setRequestHeader('Content-Length', content.length);
     request.onreadystatechange = function(shellInABox) {
       return function() {
                try {