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
7 Otherwise, how are we supposed to modify them?
9 Thanks to Georg Koppen for spotting both the problem and this fix.
11 netwerk/protocol/http/nsHttpChannel.cpp | 11 +++++++----
12 1 files changed, 7 insertions(+), 4 deletions(-)
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;
22 - // check to see if authorization headers should be included
23 - mAuthProvider->AddAuthorizationHeaders();
25 if (mLoadFlags & LOAD_NO_NETWORK_IO) {
26 return NS_ERROR_DOCUMENT_NOT_CACHED;
28 @@ -3701,6 +3698,9 @@ nsHttpChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
30 AddCookiesToRequest();
32 + // check to see if authorization headers should be included
33 + mAuthProvider->AddAuthorizationHeaders();
35 // notify "http-on-modify-request" observers
36 gHttpHandler->OnModifyRequest(this);
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();
44 + // check to see if authorization headers should be included
45 + mAuthProvider->AddAuthorizationHeaders();
47 // notify "http-on-modify-request" observers
48 gHttpHandler->OnModifyRequest(this);