Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add uncachedResponseStatusCode

ASIDownloadCache will rewrite responseStatusCode with cached headers,
thus making it impossible to see what the status code was of the actual request.
  • Loading branch information...
commit e49e9a004d5b1bce17f3075450c4c80137589e19 1 parent f99ca46
Matthew Smollinger authored
Showing with 8 additions and 0 deletions.
  1. +5 −0 Classes/ASIHTTPRequest.h
  2. +3 −0  Classes/ASIHTTPRequest.m
5 Classes/ASIHTTPRequest.h
View
@@ -261,6 +261,10 @@ typedef void (^ASIDataBlock)(NSData *data);
// HTTP status code, eg: 200 = OK, 404 = Not found etc
int responseStatusCode;
+ // HTTP status code, eg: 200 = OK, 404 = Not found etc.
+ // This does NOT change unlike responseStatusCode when cached headers are pulled from disk.
+ int uncachedResponseStatusCode;
+
// Description of the HTTP status code
NSString *responseStatusMessage;
@@ -943,6 +947,7 @@ typedef void (^ASIDataBlock)(NSData *data);
@property (retain) NSDictionary *requestCredentials;
@property (retain) NSDictionary *proxyCredentials;
@property (assign,readonly) int responseStatusCode;
+@property (assign,readonly) int uncachedResponseStatusCode;
@property (retain,readonly) NSString *responseStatusMessage;
@property (retain) NSMutableData *rawResponseData;
@property (assign) NSTimeInterval timeOutSeconds;
3  Classes/ASIHTTPRequest.m
View
@@ -204,6 +204,7 @@ - (void)callBlock:(ASIBasicBlock)block;
@property (assign) BOOL complete;
@property (retain) NSArray *responseCookies;
@property (assign) int responseStatusCode;
+@property (assign) int uncachedResponseStatusCode;
@property (retain, nonatomic) NSDate *lastActivityTime;
@property (assign) unsigned long long partialDownloadSize;
@@ -2154,6 +2155,7 @@ - (void)readResponseHeaders
[self setResponseHeaders:[NSMakeCollectable(CFHTTPMessageCopyAllHeaderFields(message)) autorelease]];
[self setResponseStatusCode:(int)CFHTTPMessageGetResponseStatusCode(message)];
+ [self setUncachedResponseStatusCode:(int)CFHTTPMessageGetResponseStatusCode(message)];
[self setResponseStatusMessage:[NSMakeCollectable(CFHTTPMessageCopyResponseStatusLine(message)) autorelease]];
if ([self downloadCache] && ([[self downloadCache] canUseCachedDataForRequest:self])) {
@@ -5032,6 +5034,7 @@ - (void)setRequestRedirectedBlock:(ASIBasicBlock)aRedirectBlock
@synthesize requestCookies;
@synthesize requestCredentials;
@synthesize responseStatusCode;
+@synthesize uncachedResponseStatusCode;
@synthesize rawResponseData;
@synthesize lastActivityTime;
@synthesize timeOutSeconds;
Please sign in to comment.
Something went wrong with that request. Please try again.