CocoaSPDY
CocoaSPDY copied to clipboard
A crash on make spdyHeaders
When we visit "http://wsq.discuz.qq.com/",we get a sub request "http:/"(NSURLConnecction + (BOOL)canHandleRequest:(NSURLRequest *)request; return YES,so this is a valid request),get a crash on [- (NSDictionary *)allSPDYHeaderFields] of NSURLRequest+SPDYURLRequest.m. The reason is host is nil,causes crash to initialize NSMutableDictionary Now I modify the code as follows:
NSMutableDictionary *spdyHeaders = [[NSMutableDictionary alloc] initWithDictionary:@{
@":method" : self.HTTPMethod ? self.HTTPMethod : @"GET",
@":path" : path ? path : @"/",
@":version" : @"HTTP/1.1",
@":host" : url.host ? url.host : @"",
@":scheme" : url.scheme ? url.scheme : @"",
}];
I tried a unit test using the url:
http://wsq.discuz.qq.com/
and allSPDYHeaderFields
works just fine, both both iOS 8.4 and 9.3 in the simulator. Can you provide some more information?
Mine is iOS7.1. I did not find the "http:/" of the reasons. May I use the more you different, I use spdy connect to our proxy server, and then send a request.Use a connection to access any web site, 'http:/' is a legitimate request, so can execute to 'allSPDYHeaderFields',here the host is nil. My English is so poor. :)