mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix NSAppTransportSecurity being overwritten during pod install (#41875)
Summary: This PR fixes https://github.com/facebook/react-native/issues/41874. ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [iOS] [Fixed] - Fix NSAppTransportSecurity being overwritten during pod install Pull Request resolved: https://github.com/facebook/react-native/pull/41875 Test Plan: 1. Delete the whole `NSAppTransportSecurity` in Info.plist and run `pod install`: `NSAllowsArbitraryLoads` and `NSAllowsLocalNetworking` are added as expected. 2. Modify `NSAppTransportSecurity` to only contain `NSExceptionDomains` and run `pod install`: `NSAllowsArbitraryLoads` and `NSAllowsLocalNetworking` are added, and `NSExceptionDomains` is still there. 3. Run `pod install` again: nothing changes. Reviewed By: christophpurrer Differential Revision: D52032400 Pulled By: dmytrorykun fbshipit-source-id: 48cf29809c283af80613ffbf1ac0dc663a0a2fb5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e4887a587a
commit
a0b76d90b7
@@ -541,7 +541,8 @@ class ReactNativePodsUtils
|
||||
"NSAppTransportSecurity" => ats_configs
|
||||
}
|
||||
else
|
||||
plist["NSAppTransportSecurity"] = ats_configs
|
||||
plist["NSAppTransportSecurity"] ||= {}
|
||||
plist["NSAppTransportSecurity"] = plist["NSAppTransportSecurity"].merge(ats_configs)
|
||||
end
|
||||
Xcodeproj::Plist.write_to_path(plist, fullPlistPath)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user