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/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 it = headers.find(scheme_header); | 195 it = headers.find(scheme_header); |
196 if (it != headers.end()) | 196 if (it != headers.end()) |
197 scheme = it->second; | 197 scheme = it->second; |
198 it = headers.find(host_header); | 198 it = headers.find(host_header); |
199 if (it != headers.end()) | 199 if (it != headers.end()) |
200 host_port = it->second; | 200 host_port = it->second; |
201 it = headers.find(path_header); | 201 it = headers.find(path_header); |
202 if (it != headers.end()) | 202 if (it != headers.end()) |
203 path = it->second; | 203 path = it->second; |
204 | 204 |
205 std::string url = (scheme.empty() || host_port.empty() || path.empty()) | 205 std::string url = scheme; |
Bence
2015/03/09 19:53:46
You don't seem to be conserving behavior here: In
| |
206 ? std::string() | 206 if (!scheme.empty() && !host_port.empty() && path.empty()) { |
207 : scheme + "://" + host_port + path; | 207 url += "://"; |
208 url += host_port; | |
209 url += path; | |
210 } | |
208 return GURL(url); | 211 return GURL(url); |
209 } | 212 } |
210 | 213 |
211 } // namespace net | 214 } // namespace net |
OLD | NEW |