Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not get the block callback when the server response 403 #1

Closed
siriuscn opened this issue Apr 24, 2016 · 2 comments
Closed

Could not get the block callback when the server response 403 #1

siriuscn opened this issue Apr 24, 2016 · 2 comments

Comments

@siriuscn
Copy link

Thanks for you nice library!
But I found a issue.

If the server response 403, and contains http body(such as nginx), the block won't be called with error.

  • (BOOL)parseRequest:(_KHIFIRequest *)request
    {
    NSData *data = request.data;//[request.data copy];

    // Get the type
    KHIFastImageType type = [self typeForImageData:data];
    if (type != KHIFastImageTypeUnsupported) {
    ....
    }
    return YES;

You pass the YES, and then the requests remove the key.

Thus - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
will not call the block.

@siriuscn siriuscn changed the title Could not got the block callback when the server response 403 Could not get the block callback when the server response 403 Apr 24, 2016
@kylehickinson
Copy link
Owner

Hey, thanks for the heads up :)

Do you have an example image URL I could use to reproduce this?

@siriuscn
Copy link
Author

I am sorry for that I could not supply the actual url in the debugging app due to business secureity limit.
But I found another public URL to reproduce it (server responses 404, the same as 403)
http://api.douban.com/noteimage/id=p32395366-2&site=www.mysite.com&key=23432453454354

The same issue.:)

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

No branches or pull requests

2 participants