summaryrefslogtreecommitdiff
blob: 2f0ef834898dae817e5d5b6a15af6bd7775ab367 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From d09a2b089ef401b08a8668b55b42233c81cbc198 Mon Sep 17 00:00:00 2001
From: Mike Perry <mikeperry-git@fscked.org>
Date: Fri, 2 Sep 2011 15:33:20 -0700
Subject: [PATCH 04/13] Add HTTP auth headers before the modify-request
 observer.

Otherwise, how are we supposed to modify them?

Thanks to Georg Koppen for spotting both the problem and this fix.
---
 netwerk/protocol/http/nsHttpChannel.cpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index 7c88d41..0cab7a4 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -328,9 +328,6 @@ nsHttpChannel::Connect(bool firstTime)
         return NS_ERROR_DOCUMENT_NOT_CACHED;
     }
 
-    // check to see if authorization headers should be included
-    mAuthProvider->AddAuthorizationHeaders();
-
     if (mLoadFlags & LOAD_NO_NETWORK_IO) {
         return NS_ERROR_DOCUMENT_NOT_CACHED;
     }
@@ -3743,6 +3740,9 @@ nsHttpChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
 
     AddCookiesToRequest();
 
+    // check to see if authorization headers should be included
+    mAuthProvider->AddAuthorizationHeaders();
+
     // notify "http-on-modify-request" observers
     gHttpHandler->OnModifyRequest(this);
 
@@ -4847,7 +4847,10 @@ nsHttpChannel::DoAuthRetry(nsAHttpConnection *conn)
     // this authentication attempt (bug 84794).
     // TODO: save cookies from auth response and send them here (bug 572151).
     AddCookiesToRequest();
-    
+   
+    // check to see if authorization headers should be included
+    mAuthProvider->AddAuthorizationHeaders();
+ 
     // notify "http-on-modify-request" observers
     gHttpHandler->OnModifyRequest(this);
 
-- 
1.7.5.4