Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

A crash on make spdyHeaders #147

Open
szrexzhu opened this issue Jul 5, 2016 · 2 comments
Open

A crash on make spdyHeaders #147

szrexzhu opened this issue Jul 5, 2016 · 2 comments

Comments

@szrexzhu
Copy link

szrexzhu commented Jul 5, 2016

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 : @"",
         }];
@kgoodier
Copy link
Contributor

kgoodier commented Jul 5, 2016

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?

@szrexzhu
Copy link
Author

szrexzhu commented Jul 7, 2016

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. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants