Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: net/http/http_network_transaction.cc

Issue 4575001: Crash fix: HTTPS server responds with 407 through non-authenticating proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 DCHECK(headers); 1082 DCHECK(headers);
1083 1083
1084 int status = headers->response_code(); 1084 int status = headers->response_code();
1085 if (status != 401 && status != 407) 1085 if (status != 401 && status != 407)
1086 return OK; 1086 return OK;
1087 HttpAuth::Target target = status == 407 ? 1087 HttpAuth::Target target = status == 407 ?
1088 HttpAuth::AUTH_PROXY : HttpAuth::AUTH_SERVER; 1088 HttpAuth::AUTH_PROXY : HttpAuth::AUTH_SERVER;
1089 if (target == HttpAuth::AUTH_PROXY && proxy_info_.is_direct()) 1089 if (target == HttpAuth::AUTH_PROXY && proxy_info_.is_direct())
1090 return ERR_UNEXPECTED_PROXY_AUTH; 1090 return ERR_UNEXPECTED_PROXY_AUTH;
1091 1091
1092 // This case can trigger when an HTTPS server responds with a 407 status
1093 // code through a non-authenticating proxy.
1094 if (!auth_controllers_[target].get())
1095 return ERR_UNEXPECTED_PROXY_AUTH;
1096
1092 int rv = auth_controllers_[target]->HandleAuthChallenge( 1097 int rv = auth_controllers_[target]->HandleAuthChallenge(
1093 headers, (request_->load_flags & LOAD_DO_NOT_SEND_AUTH_DATA) != 0, false, 1098 headers, (request_->load_flags & LOAD_DO_NOT_SEND_AUTH_DATA) != 0, false,
1094 net_log_); 1099 net_log_);
1095 if (auth_controllers_[target]->HaveAuthHandler()) 1100 if (auth_controllers_[target]->HaveAuthHandler())
1096 pending_auth_target_ = target; 1101 pending_auth_target_ = target;
1097 1102
1098 scoped_refptr<AuthChallengeInfo> auth_info = 1103 scoped_refptr<AuthChallengeInfo> auth_info =
1099 auth_controllers_[target]->auth_info(); 1104 auth_controllers_[target]->auth_info();
1100 if (auth_info.get()) 1105 if (auth_info.get())
1101 response_.auth_challenge = auth_info; 1106 response_.auth_challenge = auth_info;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 default: 1171 default:
1167 return priority; 1172 return priority;
1168 } 1173 }
1169 } 1174 }
1170 1175
1171 1176
1172 1177
1173 #undef STATE_CASE 1178 #undef STATE_CASE
1174 1179
1175 } // namespace net 1180 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698