Skip to content

Commit cbac364

Browse files
authored
fix: update user agent apollo metadata format (aws-amplify#11)
1 parent 36a06cc commit cbac364

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/AWSAppSyncApolloExtensions/Utilities/PackageInfo.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class PackageInfo {
5858
let compilerInfo = "lang/swift#\(swiftVersion)"
5959
let osInfo = "os/\(name)#\(version)"
6060
let libInfo = "lib/aws-appsync-apollo-extensions-swift#\(Self.version)"
61-
let dependenciesInfo = "md/apollo#\(Constants.ApolloVersion)"
61+
let dependenciesInfo = "md/apollo-ios#\(Constants.ApolloVersion)"
6262

6363
return "UA/2.0 \(compilerInfo) \(osInfo) \(libInfo) \(dependenciesInfo)"
6464
}

Tests/AWSAppSyncApolloExtensionsTests/Utilities/PackageInfoTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import XCTest
1212
class PackageInfoTests: XCTestCase {
1313

1414
/// user agent header has format of:
15-
/// UA/2.0 lang/swift/x.x(.x) os/[iOS, macOS, watchOS]/x.x(.x) lib/aws-appsync-apollo-extensions-swift/x.x.x
15+
/// UA/2.0 lang/swift#x.x(.x) os/[iOS, macOS, watchOS]#x.x(.x) lib/aws-appsync-apollo-extensions-swift#x.x.x md/apollo-ios#x.x.x
1616
func testUserAgentHasCorrectFormat() async throws {
1717
let pattern = "^UA/2\\.0 " +
1818
"lang/swift#\\d+\\.\\d+(?:\\.\\d+)? " +
1919
"os/(?:iOS|macOS|watchOS|tvOS)#\\d+\\.\\d+(?:\\.\\d+)? " +
2020
"lib/aws-appsync-apollo-extensions-swift#\\d+\\.\\d+\\.\\d+ " +
21-
"md/apollo#\\d+\\.\\d+\\.\\d+$"
21+
"md/apollo-ios#\\d+\\.\\d+\\.\\d+$"
2222
let regex = try NSRegularExpression(pattern: pattern)
2323
let userAgent = await PackageInfo.userAgent
2424
let matches = regex.numberOfMatches(in: userAgent, options: [], range: NSRange(location: 0, length: userAgent.utf8.count))

0 commit comments

Comments
 (0)