Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-19568] Fix ATS log messages. #7218

Merged
merged 1 commit into from
Sep 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3339,17 +3339,19 @@ iOSBuilder.prototype.writeInfoPlist = function writeInfoPlist() {

// inject Apple Transport Security settings
if (!plist.NSAppTransportSecurity || typeof plist.NSAppTransportSecurity !== 'object') {
this.logger.debug(__('Disabling ATS'));
this.logger.info(__('Disabling ATS'));
// disable ATS
plist.NSAppTransportSecurity = {
NSAllowsArbitraryLoads: true
};
} else if (!plist.NSAppTransportSecurity.NSAllowsArbitraryLoads && this.whitelistAppceleratorDotCom) {
} else if (plist.NSAppTransportSecurity.NSAllowsArbitraryLoads) {
this.logger.info(__('ATS explicitly disabled'));
} else if (this.whitelistAppceleratorDotCom) {
// we have a whitelist, make sure appcelerator.com is in the list
plist.NSAppTransportSecurity || (plist.NSAppTransportSecurity = {});
plist.NSAppTransportSecurity.NSAllowsArbitraryLoads = false;

this.logger.debug(__('Inject appcelerator.com into ATS whitelist'));
this.logger.info(__('ATS enabled, injecting appcelerator.com into ATS whitelist'));
plist.NSAppTransportSecurity.NSExceptionDomains || (plist.NSAppTransportSecurity.NSExceptionDomains = {});
if (!plist.NSAppTransportSecurity.NSExceptionDomains['appcelerator.com']) {
plist.NSAppTransportSecurity.NSExceptionDomains['appcelerator.com'] = {
Expand All @@ -3364,7 +3366,8 @@ iOSBuilder.prototype.writeInfoPlist = function writeInfoPlist() {
};
}
} else {
this.logger.debug(__('ATS enabled, but appcelerator.com sites will be unreachable'));
this.logger.warn(__('ATS enabled, however *.appcelerator.com are not whitelisted'));
this.logger.warn(__('Consider setting the "ios.whitelist.appcelerator.com" property in the tiapp.xml to "true"'));
}

if (this.target === 'device' && this.deviceId === 'itunes') {
Expand Down