Commit 2155896
authored
fix: make iOS requests recognized by backend (#159)
Adds simple user-agent to make gonfalon recognize iOS. Later should be
made proper but it should be here until gonfalon update
Later should be similar to this
// func buildUserAgent(sdkVersion: String) -> String {
// let device = UIDevice.current
// let osVersion = device.systemVersion.replacingOccurrences(of: ".",
with: "_")
// let model = device.model // "iPhone" or "iPad"
// let buildNumber = Bundle.main.infoDictionary?["CFBundleVersion"] as?
String ?? "0"
//
// if model == "iPad" {
// return "Mozilla/5.0 (\(model); CPU OS \(osVersion) like Mac OS X)
Mobile/\(buildNumber) YourSDK/\(sdkVersion)"
// } else {
// return "Mozilla/5.0 (\(model); CPU \(model) OS \(osVersion) like Mac
OS X) Mobile/\(buildNumber) YourSDK/\(sdkVersion)"
// }
// }
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: adds a static `User-Agent` default header to outgoing
GraphQL requests, with no change to request/response handling beyond the
extra header.
>
> **Overview**
> Adds a default `User-Agent: iOS` header to `GraphQLClient`’s
`defaultHeaders`, ensuring all GraphQL requests identify as iOS unless
explicitly overridden by per-call headers.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
164b955. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 17a5475 commit 2155896
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments