Skip to content

Commit

Permalink
Adds X-Is-Debug-Build header (#4364)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayShortway authored Oct 10, 2024
1 parent 914edb7 commit 57766ce
Show file tree
Hide file tree
Showing 783 changed files with 834 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Sources/Misc/SystemInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ class SystemInfo {
return self._isSandbox
}

var isDebugBuild: Bool {
#if DEBUG
return true
#else
return false
#endif
}

var storefront: StorefrontType? {
return self.storefrontProvider.currentStorefront
}
Expand Down
3 changes: 2 additions & 1 deletion Sources/Networking/HTTPClient/HTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ class HTTPClient {
"X-StoreKit-Version": "\(self.systemInfo.storeKitVersion.effectiveVersion)",
"X-Observer-Mode-Enabled": "\(self.systemInfo.observerMode)",
RequestHeader.retryCount.rawValue: "0",
RequestHeader.sandbox.rawValue: "\(self.systemInfo.isSandbox)"
RequestHeader.sandbox.rawValue: "\(self.systemInfo.isSandbox)",
"X-Is-Debug-Build": "\(self.systemInfo.isDebugBuild)"
]

if let storefront = self.systemInfo.storefront {
Expand Down
5 changes: 5 additions & 0 deletions Tests/UnitTests/Mocks/MockSystemInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class MockSystemInfo: SystemInfo {

var stubbedIsApplicationBackgrounded: Bool?
var stubbedIsSandbox: Bool?
var stubbedIsDebugBuild: Bool?
var stubbedStorefront: StorefrontType?

convenience init(platformInfo: Purchases.PlatformInfo? = nil,
Expand Down Expand Up @@ -55,6 +56,10 @@ class MockSystemInfo: SystemInfo {
return self.stubbedIsSandbox ?? super.isSandbox
}

override var isDebugBuild: Bool {
return self.stubbedIsDebugBuild ?? super.isDebugBuild
}

override var storefront: StorefrontType? {
return self.stubbedStorefront
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"X-Client-Build-Version" : "12345",
"X-Client-Bundle-ID" : "com.apple.dt.xctest.tool",
"X-Client-Version" : "17.0.0",
"X-Is-Debug-Build" : "true",
"X-Is-Sandbox" : "true",
"X-Observer-Mode-Enabled" : "false",
"X-Platform" : "iOS",
Expand Down
Loading

0 comments on commit 57766ce

Please sign in to comment.