summaryrefslogtreecommitdiffstats
path: root/net/http/http_util.cc
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-04 02:33:58 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-04 02:33:58 +0000
commit7ec7c1899afc8537bb25ce373aa2e136aa7788dc (patch)
treec108e17742ec31aef01eef3824d1388b8a3f8937 /net/http/http_util.cc
parent5cd1f8f498abd2ed8d0bd545b224b95918cbec72 (diff)
downloadchromium_src-7ec7c1899afc8537bb25ce373aa2e136aa7788dc.zip
chromium_src-7ec7c1899afc8537bb25ce373aa2e136aa7788dc.tar.gz
chromium_src-7ec7c1899afc8537bb25ce373aa2e136aa7788dc.tar.bz2
Split out HttpUtil::SpecForRequest() into a more generic function of net_util.h.
This was a TODO, since that function is useful outside of HTTP. In the process, I uncovered some test cases in proxy_service that are passing in invalid URLs (by virtue of the extra DCHECK). This doesn't make much sense to me to support that, so I have changed them. Review URL: http://codereview.chromium.org/160558 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_util.cc')
-rw-r--r--net/http/http_util.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/http/http_util.cc b/net/http/http_util.cc
index 5e81dab..4381117 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/string_piece.h"
#include "base/string_util.h"
+#include "net/base/net_util.h"
using std::string;
@@ -63,11 +64,7 @@ std::string HttpUtil::PathForRequest(const GURL& url) {
// static
std::string HttpUtil::SpecForRequest(const GURL& url) {
DCHECK(url.is_valid() && (url.SchemeIs("http") || url.SchemeIs("https")));
- GURL::Replacements replacements;
- replacements.ClearUsername();
- replacements.ClearPassword();
- replacements.ClearRef();
- return url.ReplaceComponents(replacements).spec();
+ return SimplifyUrlForRequest(url).spec();
}
// static