mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
[Objc] Moved [request setHTTPShouldHandleCookies:NO]; to postProcessRequest method for easier override to modify request.
This commit is contained in:
parent
567c23a3df
commit
ac37c43649
@ -329,10 +329,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response)
|
||||
}
|
||||
|
||||
// request cache
|
||||
BOOL hasHeaderParams = false;
|
||||
if (headerParams != nil && [headerParams count] > 0) {
|
||||
hasHeaderParams = true;
|
||||
}
|
||||
BOOL hasHeaderParams = [headerParams count] > 0;
|
||||
if (offlineState) {
|
||||
{{classPrefix}}DebugLog(@"%@ cache forced", resourcePath);
|
||||
[request setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
|
||||
@ -353,9 +350,7 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response)
|
||||
}
|
||||
[self.requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"];
|
||||
|
||||
|
||||
// Always disable cookies!
|
||||
[request setHTTPShouldHandleCookies:NO];
|
||||
[self postProcessRequest:request];
|
||||
|
||||
NSNumber* requestId = [{{classPrefix}}ApiClient queueRequest];
|
||||
if ([responseType isEqualToString:@"NSURL*"] || [responseType isEqualToString:@"NSURL"]) {
|
||||
@ -376,6 +371,12 @@ static NSString * {{classPrefix}}__fileNameForResponse(NSURLResponse *response)
|
||||
return requestId;
|
||||
}
|
||||
|
||||
//Added for easier override to modify request
|
||||
-(void)postProcessRequest:(NSMutableURLRequest *)request {
|
||||
// Always disable cookies!
|
||||
[request setHTTPShouldHandleCookies:NO];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (NSString*) pathWithQueryParamsToString:(NSString*) path
|
||||
|
@ -6,7 +6,7 @@ This ObjC package is automatically generated by the [Swagger Codegen](https://gi
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version:
|
||||
- Build date: 2016-05-11T17:37:37.440+02:00
|
||||
- Build date: 2016-05-11T18:16:45.229+02:00
|
||||
- Build package: class io.swagger.codegen.languages.ObjcClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
@ -329,10 +329,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) {
|
||||
}
|
||||
|
||||
// request cache
|
||||
BOOL hasHeaderParams = false;
|
||||
if (headerParams != nil && [headerParams count] > 0) {
|
||||
hasHeaderParams = true;
|
||||
}
|
||||
BOOL hasHeaderParams = [headerParams count] > 0;
|
||||
if (offlineState) {
|
||||
SWGDebugLog(@"%@ cache forced", resourcePath);
|
||||
[request setCachePolicy:NSURLRequestReturnCacheDataDontLoad];
|
||||
@ -353,9 +350,7 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) {
|
||||
}
|
||||
[self.requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"];
|
||||
|
||||
|
||||
// Always disable cookies!
|
||||
[request setHTTPShouldHandleCookies:NO];
|
||||
[self postProcessRequest:request];
|
||||
|
||||
NSNumber* requestId = [SWGApiClient queueRequest];
|
||||
if ([responseType isEqualToString:@"NSURL*"] || [responseType isEqualToString:@"NSURL"]) {
|
||||
@ -376,6 +371,12 @@ static NSString * SWG__fileNameForResponse(NSURLResponse *response) {
|
||||
return requestId;
|
||||
}
|
||||
|
||||
//Added for easier override to modify request
|
||||
-(void)postProcessRequest:(NSMutableURLRequest *)request {
|
||||
// Always disable cookies!
|
||||
[request setHTTPShouldHandleCookies:NO];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (NSString*) pathWithQueryParamsToString:(NSString*) path
|
||||
|
Loading…
Reference in New Issue
Block a user