[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [meek/master] Don't strip Host when we are pruning headers.



commit 03f499bde18c4ea7dd8e349b71c8f603321634fd
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Sat Mar 21 14:33:25 2015 -0700

    Don't strip Host when we are pruning headers.
    
    Stripping Host made it not work to use a url= without a front=. When you
    omit front=, it's supposed to take the Host from the url= argument. This
    is when you connect directly to the bridge, like
    	bridge meek 0.0.2.0:3 url=https://meek.bamsoftware.com/
---
 firefox/components/main.js |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/firefox/components/main.js b/firefox/components/main.js
index ea5d050..188429d 100644
--- a/firefox/components/main.js
+++ b/firefox/components/main.js
@@ -272,8 +272,10 @@ MeekHTTPHelper.LocalConnectionHandler.prototype = {
         // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel#visitRequestHeaders%28%29
         // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpHeaderVisitor
         this.channel.visitRequestHeaders({visitHeader: function(key, value) { headers.push(key); }})
-        for (let i = 0; i < headers.length; i++)
-            this.channel.setRequestHeader(headers[i], "", false);
+        for (let i = 0; i < headers.length; i++) {
+            if (headers[i] !== "Host")
+                this.channel.setRequestHeader(headers[i], "", false);
+        }
         // Set our own headers.
         if (req.header !== undefined) {
             for (let key in req.header) {

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits