I'm investigating cache hits and misses on my own subclass of NSURLProtocol. I have a request that looks like this (from a UIWebView)
https://www.my.server/?myqueryParams
For now, I am using simple string comparisons on the URLs:
+ (BOOL)requestIsCacheEquivalent:(NSURLRequest *)a toRequest:(NSURLRequest *)b
{
bool equal = [a.URL.absoluteString isEqualToString:b.URL.absoluteString];
NSLog(@"A: %@, B: %@", a.URL.absoluteString, b.URL.absoluteString);
return equal;
}
What I see in the logs is that "a" has a trailing slash. It looks like this:
a -> https://www.my.server/?myqueryParams/
b -> https://www.my.server/?myqueryParams
I'm trying to debug where this trailing slash could be coming from. I realize that I don't even know what is responsible for calling this method -- it has a very limited backtrace.
Where do "a" and "b" come from? And where might that slash have come from?