pokeb / asi-http-request

Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone
http://allseeing-i.com/ASIHTTPRequest
Other
5.78k stars 1.41k forks source link

Incorrect external request url building in ASIWebPageRequest #383

Open pdyakov opened 10 years ago

pdyakov commented 10 years ago

Issue in ASIWebPageRequest.m Line: 270 - ASIWebPageRequest *externalResourceRequest = [ASIWebPageRequest requestWithURL:[NSURL URLWithString:theURL relativeToURL:[self url]]];

After this line external resource request url is incorrect. If we download some internal web page, then urls for resources builds as relative to full url instead of base url. This fixes the issue:

ASIWebPageRequest *externalResourceRequest = [ASIWebPageRequest requestWithURL:[NSURL URLWithString:theURL relativeToURL:[[self url] baseURL]]];

Is it a correct solution or something missing?