]> Pileus Git - ~andy/sunrise/blob - www-client/torbrowser/files/0004-Add-HTTP-auth-headers-before-the-modify-request-obse.patch
www-client/torbrowser: New Ebuild for bug 406361 thanks to Tommy[D] and floppym
[~andy/sunrise] / www-client / torbrowser / files / 0004-Add-HTTP-auth-headers-before-the-modify-request-obse.patch
1 From 6dc27a50e06bca139a07546f94a827f1fdb762b7 Mon Sep 17 00:00:00 2001
2 From: Mike Perry <mikeperry-git@fscked.org>
3 Date: Fri, 2 Sep 2011 15:33:20 -0700
4 Subject: [PATCH 04/13] Add HTTP auth headers before the modify-request
5  observer.
6
7 Otherwise, how are we supposed to modify them?
8
9 Thanks to Georg Koppen for spotting both the problem and this fix.
10 ---
11  netwerk/protocol/http/nsHttpChannel.cpp |   11 +++++++----
12  1 files changed, 7 insertions(+), 4 deletions(-)
13
14 diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
15 index dec2a83..4c5e759 100644
16 --- a/netwerk/protocol/http/nsHttpChannel.cpp
17 +++ b/netwerk/protocol/http/nsHttpChannel.cpp
18 @@ -316,9 +316,6 @@ nsHttpChannel::Connect(bool firstTime)
19          return NS_ERROR_DOCUMENT_NOT_CACHED;
20      }
21  
22 -    // check to see if authorization headers should be included
23 -    mAuthProvider->AddAuthorizationHeaders();
24 -
25      if (mLoadFlags & LOAD_NO_NETWORK_IO) {
26          return NS_ERROR_DOCUMENT_NOT_CACHED;
27      }
28 @@ -3701,6 +3698,9 @@ nsHttpChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
29  
30      AddCookiesToRequest();
31  
32 +    // check to see if authorization headers should be included
33 +    mAuthProvider->AddAuthorizationHeaders();
34 +
35      // notify "http-on-modify-request" observers
36      gHttpHandler->OnModifyRequest(this);
37  
38 @@ -4795,7 +4795,10 @@ nsHttpChannel::DoAuthRetry(nsAHttpConnection *conn)
39      // this authentication attempt (bug 84794).
40      // TODO: save cookies from auth response and send them here (bug 572151).
41      AddCookiesToRequest();
42 -    
43 +   
44 +    // check to see if authorization headers should be included
45 +    mAuthProvider->AddAuthorizationHeaders();
46
47      // notify "http-on-modify-request" observers
48      gHttpHandler->OnModifyRequest(this);
49  
50 -- 
51 1.7.5.4
52