问题
I am writing an IOS9 app which uses flickr.
Flicker uses an url format of https://farm{farm-id}.staticflickr.com/
The farm id is a number
In my info.plist I have defined whitelisted domains NSAppTransportSecurity - NSExceptionDomains
How can I define these for the farm id as a wild card?
Currently I just did farm1.staticflickr.com farm2.staticflickr.com......up till 9 but I am unsure how far flickr goes.
回答1:
Add an exception for staticflickr.com
and in that exception add a key called NSIncludesSubdomains
and set it to true.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>staticflickr.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
来源:https://stackoverflow.com/questions/32382541/app-transport-security-exceptions-ios9