Skip to content

Commit

Permalink
Add accept as one of the desired headers to be passed through on redi…
Browse files Browse the repository at this point in the history
…rects
  • Loading branch information
soffes authored and pokeb committed Aug 30, 2010
1 parent 6c04014 commit 1c16986
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/ASIHTTPRequest.m
Expand Up @@ -1886,10 +1886,13 @@ - (void)readResponseHeaders

// Perhaps there are other headers we should be preserving, but it's hard to know what we need to keep and what to throw away.
NSString *userAgent = [[self requestHeaders] objectForKey:@"User-Agent"];
NSString *accept = [[self requestHeaders] objectForKey:@"Accept"];
[self setRequestHeaders:nil];
if (userAgent) {
[self setRequestHeaders:[NSMutableDictionary dictionaryWithObject:userAgent forKey:@"User-Agent"]];
} else {
[self setRequestHeaders:nil];
[self addRequestHeader:@"User-Agent" value:userAgent];
}
if (accept) {
[self addRequestHeader:@"Accept" value:accept];
}
[self setHaveBuiltRequestHeaders:NO];
} else {
Expand Down

0 comments on commit 1c16986

Please sign in to comment.