OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/spdy/spdy_http_utils.h" | 5 #include "net/spdy/spdy_http_utils.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 it = headers.find(scheme_header); | 181 it = headers.find(scheme_header); |
182 if (it != headers.end()) | 182 if (it != headers.end()) |
183 scheme = it->second; | 183 scheme = it->second; |
184 it = headers.find(host_header); | 184 it = headers.find(host_header); |
185 if (it != headers.end()) | 185 if (it != headers.end()) |
186 host_port = it->second; | 186 host_port = it->second; |
187 it = headers.find(path_header); | 187 it = headers.find(path_header); |
188 if (it != headers.end()) | 188 if (it != headers.end()) |
189 path = it->second; | 189 path = it->second; |
190 | 190 |
191 std::string url = (scheme.empty() || host_port.empty() || path.empty()) | 191 std::string url = (scheme.empty() || host_port.empty() || path.empty()) |
192 ? "" : scheme + "://" + host_port + path; | 192 ? std::string() |
| 193 : scheme + "://" + host_port + path; |
193 return GURL(url); | 194 return GURL(url); |
194 } | 195 } |
195 | 196 |
196 bool ShouldShowHttpHeaderValue(const std::string& header_name) { | 197 bool ShouldShowHttpHeaderValue(const std::string& header_name) { |
197 #if defined(SPDY_PROXY_AUTH_ORIGIN) | 198 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
198 if (header_name == "proxy-authorization") | 199 if (header_name == "proxy-authorization") |
199 return false; | 200 return false; |
200 #endif | 201 #endif |
201 return true; | 202 return true; |
202 } | 203 } |
203 | 204 |
204 } // namespace net | 205 } // namespace net |
OLD | NEW |