diff --git a/netwerk/protocol/http/src/nsHTTPChannel.cpp b/netwerk/protocol/http/src/nsHTTPChannel.cpp index 36df94628608..2acceb98326f 100644 --- a/netwerk/protocol/http/src/nsHTTPChannel.cpp +++ b/netwerk/protocol/http/src/nsHTTPChannel.cpp @@ -889,7 +889,12 @@ nsHTTPChannel::GenerateCacheKey(nsAWritableCString &cacheKey) cacheKey.Append(buf); cacheKey.Append("&url="); } - cacheKey.Append(mRequest->Spec()); + // Strip any trailing #ref from the URL before using it as the key + char *p = PL_strchr(mRequest->Spec(), '#'); + if (p) + cacheKey.Append(mRequest->Spec(), p - mRequest->Spec()); + else + cacheKey.Append(mRequest->Spec()); return NS_OK; }