Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Handle authentication challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
JinlianWang committed Oct 16, 2015
1 parent ff1b24c commit e258c20
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions SWHttpTrafficRecorder.m
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,23 @@ - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)err
}];
}


- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
[self.client URLProtocol:self didReceiveAuthenticationChallenge:challenge];
}

- (void)connection:(NSURLConnection *)connection didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
[self.client URLProtocol:self didCancelAuthenticationChallenge:challenge];
}

- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response {
if (response != nil) {
[[self client] URLProtocol:self wasRedirectedToRequest:request redirectResponse:response];
}
return request;
}


#pragma mark - File Creation Utility Methods

-(NSString *)getFileName:(NSURLRequest *)request{
Expand Down

0 comments on commit e258c20

Please sign in to comment.