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

[tor-commits] [tor-browser/tor-browser-68.2.0esr-9.5-1] Revert "Bug 32255: Set Origin to null for CORS requests"



commit 9de14da5e2a82b6e1ea4a4c68328996cbcc847ce
Author: Alex Catarineu <acat@xxxxxxxxxxxxxx>
Date:   Tue Nov 26 13:31:20 2019 +0100

    Revert "Bug 32255: Set Origin to null for CORS requests"
    
    This reverts commit f26fb9c17d71f3373c8ccb91ae74c438d9e13f80.
---
 netwerk/protocol/http/nsCORSListenerProxy.cpp | 2 +-
 netwerk/protocol/http/nsHttpChannel.cpp       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/netwerk/protocol/http/nsCORSListenerProxy.cpp b/netwerk/protocol/http/nsCORSListenerProxy.cpp
index 36027a5d2809..36b263ddf003 100644
--- a/netwerk/protocol/http/nsCORSListenerProxy.cpp
+++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp
@@ -985,7 +985,7 @@ nsresult nsCORSListenerProxy::UpdateChannel(nsIChannel* aChannel,
 
     if (!currentOrgin.EqualsIgnoreCase(origin.get()) &&
         StringEndsWith(potentialOnionHost, NS_LITERAL_CSTRING(".onion"))) {
-      origin.AssignLiteral("null");
+      origin.Truncate();
     }
   }
 
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index 362607d113ca..b2d58379affe 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -9647,8 +9647,8 @@ void nsHttpChannel::SetOriginHeader() {
       nsAutoCString currentOrigin;
       nsContentUtils::GetASCIIOrigin(mURI, currentOrigin);
       if (!origin.EqualsIgnoreCase(currentOrigin.get())) {
-        // Origin header set to null by .onion
-        origin.AssignLiteral("null");
+        // Origin header is suppressed by .onion
+        return;
       }
     }
   }



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