Skip to content

Commit f252a0a

Browse files
committed
Gate cleartext HTTP traffic settings to non-production variants
NSAllowsArbitraryLoads on iOS and the withAndroidCleartextTraffic plugin were applied unconditionally to all build variants, including production. This exposed production users to potential man-in-the-middle attacks. Now both settings are only applied for development and preview variants, using the existing APP_VARIANT infrastructure.
1 parent acdfb6a commit f252a0a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

apps/mobile/app.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ const config: ExpoConfig = {
7777
supportsTablet: true,
7878
bundleIdentifier: variant.iosBundleIdentifier,
7979
infoPlist: {
80-
NSAppTransportSecurity: {
81-
NSAllowsArbitraryLoads: true,
82-
},
80+
...(APP_VARIANT !== "production" && {
81+
NSAppTransportSecurity: {
82+
NSAllowsArbitraryLoads: true,
83+
},
84+
}),
8385
ITSAppUsesNonExemptEncryption: false,
8486
},
8587
},
@@ -128,7 +130,7 @@ const config: ExpoConfig = {
128130
],
129131
"expo-secure-store",
130132
"expo-router",
131-
"./plugins/withAndroidCleartextTraffic.cjs",
133+
...(APP_VARIANT !== "production" ? ["./plugins/withAndroidCleartextTraffic.cjs"] : []),
132134
],
133135
extra: {
134136
appVariant: APP_VARIANT,

0 commit comments

Comments
 (0)