| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |