Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Unified Diff: net/tools/quic/quic_in_memory_cache.cc

Issue 16354006: Fix a bug in quic_in_memory_cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@quic_clientserver2
Patch Set: Add unittest. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/net.gyp ('k') | net/tools/quic/quic_in_memory_cache_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_in_memory_cache.cc
diff --git a/net/tools/quic/quic_in_memory_cache.cc b/net/tools/quic/quic_in_memory_cache.cc
index 0de0bc0d48f0dae88c0814c474f8c89cf990ead4..5c02ca64dfb624d29da6f877c8c1e008c82adb6c 100644
--- a/net/tools/quic/quic_in_memory_cache.cc
+++ b/net/tools/quic/quic_in_memory_cache.cc
@@ -86,7 +86,16 @@ QuicInMemoryCache* QuicInMemoryCache::GetInstance() {
const QuicInMemoryCache::Response* QuicInMemoryCache::GetResponse(
const BalsaHeaders& request_headers) const {
- ResponseMap::const_iterator it = responses_.find(GetKey(request_headers));
+ string key = GetKey(request_headers);
+ StringPiece url(key);
+ // Removing the leading https:// or http://.
+ if (StringPieceUtils::StartsWithIgnoreCase(url, "https://")) {
+ url.remove_prefix(8);
+ } else if (StringPieceUtils::StartsWithIgnoreCase(url, "http://")) {
+ url.remove_prefix(7);
+ }
+
+ ResponseMap::const_iterator it = responses_.find(url.as_string());
if (it == responses_.end()) {
return NULL;
}
« no previous file with comments | « net/net.gyp ('k') | net/tools/quic/quic_in_memory_cache_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698