Committed by
Ben Copsey
Added property to switch HTTP version.
Signed-off-by: Ben Copsey <ben@allseeing-i.com>
Showing
2 changed files
with
4 additions
and
1 deletions
@@ -212,6 +212,7 @@ typedef enum _ASINetworkErrorType { | @@ -212,6 +212,7 @@ typedef enum _ASINetworkErrorType { | ||
212 | // Custom user information assosiated with the request | 212 | // Custom user information assosiated with the request |
213 | NSDictionary *userInfo; | 213 | NSDictionary *userInfo; |
214 | 214 | ||
215 | + BOOL HTTPVersionOne; | ||
215 | 216 | ||
216 | } | 217 | } |
217 | 218 | ||
@@ -395,5 +396,6 @@ typedef enum _ASINetworkErrorType { | @@ -395,5 +396,6 @@ typedef enum _ASINetworkErrorType { | ||
395 | @property (retain) NSInputStream *postBodyReadStream; | 396 | @property (retain) NSInputStream *postBodyReadStream; |
396 | @property (assign) BOOL shouldStreamPostDataFromDisk; | 397 | @property (assign) BOOL shouldStreamPostDataFromDisk; |
397 | @property (assign) BOOL didCreateTemporaryPostDataFile; | 398 | @property (assign) BOOL didCreateTemporaryPostDataFile; |
399 | +@property (assign) BOOL HTTPVersionOne; | ||
398 | 400 | ||
399 | @end | 401 | @end |
@@ -301,7 +301,7 @@ static NSError *ASIUnableToCreateRequestError; | @@ -301,7 +301,7 @@ static NSError *ASIUnableToCreateRequestError; | ||
301 | } | 301 | } |
302 | 302 | ||
303 | // Create a new HTTP request. | 303 | // Create a new HTTP request. |
304 | - request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)requestMethod, (CFURLRef)url, kCFHTTPVersion1_1); | 304 | + request = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)requestMethod, (CFURLRef)url, self.HTTPVersionOne ? kCFHTTPVersion1_0 : kCFHTTPVersion1_1); |
305 | if (!request) { | 305 | if (!request) { |
306 | [self failWithError:ASIUnableToCreateRequestError]; | 306 | [self failWithError:ASIUnableToCreateRequestError]; |
307 | return; | 307 | return; |
@@ -1625,4 +1625,5 @@ static NSError *ASIUnableToCreateRequestError; | @@ -1625,4 +1625,5 @@ static NSError *ASIUnableToCreateRequestError; | ||
1625 | @synthesize postBodyReadStream; | 1625 | @synthesize postBodyReadStream; |
1626 | @synthesize shouldStreamPostDataFromDisk; | 1626 | @synthesize shouldStreamPostDataFromDisk; |
1627 | @synthesize didCreateTemporaryPostDataFile; | 1627 | @synthesize didCreateTemporaryPostDataFile; |
1628 | +@synthesize HTTPVersionOne; | ||
1628 | @end | 1629 | @end |
-
Please register or login to post a comment