Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

AFHTTPSessionManager now copies its securityPolicy #2887

Merged
merged 2 commits into from
Oct 21, 2015
Merged

Conversation

kcharwood
Copy link
Contributor

When I tried to copy the AFHTTPSessionManager the securityPolicy doesn't get copied with it.

@hardikdevios
Copy link

@mohamede1945 have you changed the SecurityPolicy in your manager other than AFSSLPinningModeNone ?

@mohamede1945
Copy link
Author

Yes

@hardikdevios
Copy link

@mohamede1945 so when you do copy it reverted back to the AFSSLPinningModeNone, right ?

@mohamede1945
Copy link
Author

Please, look at the copy method code, it's obvious that the property is not copied.

@hardikdevios
Copy link

@mohamede1945 yes i know the method doesn't have that copy with zone because AFSecurityPolicy doesn't confirm the NSCopying protocol.

@kcharwood
Copy link
Contributor

@mohamede1945 Would you be willing to create a patch? Thanks! 🍻

@mohamede1945
Copy link
Author

@kcharwood Yeah sure, I'll do it over the weekend.

@kcharwood kcharwood added this to the 2.6.2 milestone Oct 19, 2015
@kcharwood
Copy link
Contributor

cc @cnoon @kylef @jshier for a sanity check here.

Also updated AFHTTPSessionManager and AFHTTPRequestManager to use the copying/encoding/decoding features for the security policy as well.

This will need to go into 3.0.0 as well.

return YES;
}

- (id)initWithCoder:(NSCoder *)decoder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this id to instancetype please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Updated.

@kylef
Copy link
Contributor

kylef commented Oct 19, 2015

👍 from me.

kcharwood added a commit that referenced this pull request Oct 21, 2015
AFHTTPSessionManager copying securityPolicy not getting copied
@kcharwood kcharwood merged commit c94299a into master Oct 21, 2015
@kcharwood kcharwood modified the milestones: 2.7.0, 2.6.2 Oct 21, 2015
@kcharwood
Copy link
Contributor

Merged in to the 3_0_0 branch with f573fdb

@kcharwood kcharwood deleted the security/2887 branch October 21, 2015 13:17
@kcharwood kcharwood changed the title AFHTTPSessionManager copying securityPolicy not getting copied AFHTTPSessionManager now copies its securityPolicy Nov 3, 2015
@kcharwood kcharwood added the added label Nov 3, 2015
sergiou87 pushed a commit to plexinc/AFNetworking that referenced this pull request Dec 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants