From ab783797166b4277cf65ceace2621e1e7a73a14c Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Tue, 3 Apr 2018 12:32:12 +0200 Subject: [PATCH] - fix setHttpHeaderValue --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++ Example/Podfile.lock | 4 +-- .../Pods/Local Podspecs/PNObject.podspec.json | 4 +-- Example/Pods/Manifest.lock | 4 +-- PNObject.podspec | 2 +- PNObject/Classes/PNObjectConfig.m | 28 ++++++++++++++++++- 6 files changed, 42 insertions(+), 8 deletions(-) create mode 100644 Example/PNObject.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Example/PNObject.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/PNObject.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/PNObject.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/Podfile.lock b/Example/Podfile.lock index cd87a4f..05fcdc1 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -38,7 +38,7 @@ PODS: - NSString-Helper (1.0.6) - nv-ios-http-status (0.0.1) - PEAR-FileManager-iOS (1.3.1) - - PNObject (2.5): + - PNObject (2.5.1): - AFNetworking - CodFis-Helper - DDDKeychainWrapper @@ -85,7 +85,7 @@ SPEC CHECKSUMS: NSString-Helper: 389265918b2a4c5b0d09f0e03c607e8e5e254dd7 nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3 - PNObject: 8ca962a9c8cf4c00bdf3815bd52637ffd4fb4148 + PNObject: 727e7724717c5c3b4d995b0dfa246897fe4d39de PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109 Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66 diff --git a/Example/Pods/Local Podspecs/PNObject.podspec.json b/Example/Pods/Local Podspecs/PNObject.podspec.json index 3bdec24..5234b75 100644 --- a/Example/Pods/Local Podspecs/PNObject.podspec.json +++ b/Example/Pods/Local Podspecs/PNObject.podspec.json @@ -1,6 +1,6 @@ { "name": "PNObject", - "version": "2.5", + "version": "2.5.1", "summary": "PNObject is a simple replica of the more complex ParseObject", "homepage": "https://github.com/giuseppenucifora/PNObject", "license": { @@ -12,7 +12,7 @@ }, "source": { "git": "https://github.com/giuseppenucifora/PNObject.git", - "tag": "2.5" + "tag": "2.5.1" }, "platforms": { "ios": "8.0" diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index cd87a4f..05fcdc1 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -38,7 +38,7 @@ PODS: - NSString-Helper (1.0.6) - nv-ios-http-status (0.0.1) - PEAR-FileManager-iOS (1.3.1) - - PNObject (2.5): + - PNObject (2.5.1): - AFNetworking - CodFis-Helper - DDDKeychainWrapper @@ -85,7 +85,7 @@ SPEC CHECKSUMS: NSString-Helper: 389265918b2a4c5b0d09f0e03c607e8e5e254dd7 nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3 - PNObject: 8ca962a9c8cf4c00bdf3815bd52637ffd4fb4148 + PNObject: 727e7724717c5c3b4d995b0dfa246897fe4d39de PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109 Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66 diff --git a/PNObject.podspec b/PNObject.podspec index 1e29ade..e0f4d2a 100644 --- a/PNObject.podspec +++ b/PNObject.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'PNObject' -s.version = '2.5' +s.version = '2.5.1' s.summary = 'PNObject is a simple replica of the more complex ParseObject' diff --git a/PNObject/Classes/PNObjectConfig.m b/PNObject/Classes/PNObjectConfig.m index 1ed05f9..7facd52 100644 --- a/PNObject/Classes/PNObjectConfig.m +++ b/PNObject/Classes/PNObjectConfig.m @@ -282,7 +282,7 @@ static bool isFirstAccess = YES; _currentUserCredenzialEndPointPath = [NSString stringWithFormat:_currentUserCredenzialEndPointPath,_currentEndPointPath]; } _currentUserCredenzialEndPointUrl = [_currentBaseUrl stringByAppendingString:_currentUserCredenzialEndPointPath]; - + _currentUserCredenzialRefreshTokenEnabled = [currentEnvConfig objectForKey:Client_Refresh_Token_Enabled]; } @@ -775,12 +775,38 @@ static bool isFirstAccess = YES; - (void) setHTTPHeaderValue:(NSString * _Nonnull)value forKey:(NSString * _Nonnull) key { [_headerFields setObject:value forKey:key]; + + if (_managerHttpRequestSerializer) { + [_managerHttpRequestSerializer setValue:value forHTTPHeaderField:key]; + } + if (_managerJsonRequestSerializer) { + [_managerJsonRequestSerializer setValue:value forHTTPHeaderField:key]; + } + if (_oauthHttpRequestSerializer) { + [_oauthHttpRequestSerializer setValue:value forHTTPHeaderField:key]; + } + if (_oauthJsonRequestSerializer) { + [_oauthJsonRequestSerializer setValue:value forHTTPHeaderField:key]; + } } - (void) removeHTTPHeaderValueForKey:(NSString * _Nonnull) key { if ([_headerFields objectForKey:key]) { [_headerFields removeObjectForKey:key]; } + + if (_managerHttpRequestSerializer) { + [_managerHttpRequestSerializer setValue:nil forHTTPHeaderField:key]; + } + if (_managerJsonRequestSerializer) { + [_managerJsonRequestSerializer setValue:nil forHTTPHeaderField:key]; + } + if (_oauthHttpRequestSerializer) { + [_oauthHttpRequestSerializer setValue:nil forHTTPHeaderField:key]; + } + if (_oauthJsonRequestSerializer) { + [_oauthJsonRequestSerializer setValue:nil forHTTPHeaderField:key]; + } } - (void) setClientID:(NSString * _Nonnull) clientID clientSecret:(NSString* _Nonnull) clientSecret oAuthEndpointAction:(NSString* _Nonnull) oAuthEndpointAction oauthMode:(OAuthMode) oauthMode refreshTokenEnabled:(BOOL) refreshTokenEnabled forEnv:(NSString * _Nonnull) environment {