diff options
Diffstat (limited to 'net/tools')
-rw-r--r-- | net/tools/dump_cache/cache_dumper.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/tools/dump_cache/cache_dumper.cc b/net/tools/dump_cache/cache_dumper.cc index 1120817..20ba6b5 100644 --- a/net/tools/dump_cache/cache_dumper.cc +++ b/net/tools/dump_cache/cache_dumper.cc @@ -64,7 +64,10 @@ bool SafeCreateDirectory(const std::wstring& path) { bool DiskDumper::CreateEntry(const std::string& key, disk_cache::Entry** entry) { FilePath path(path_); - entry_path_ = net::UrlToFilenameEncoder::Encode(key, path); + // The URL may not start with a valid protocol; search for it. + int urlpos = key.find("http"); + std::string url = urlpos > 0 ? key.substr(urlpos) : key; + entry_path_ = net::UrlToFilenameEncoder::Encode(url, path); #ifdef WIN32_LARGE_FILENAME_SUPPORT // In order for long filenames to work, we'll need to prepend |