-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #908 from WalletConnect/feature/w3m-explorer-user-…
…agent [W3M] Custom User-Agent for metrics
- Loading branch information
Showing
7 changed files
with
57 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#if !CocoaPods | ||
@_exported import WalletConnectSign | ||
@_exported import WalletConnectPairing | ||
@_exported import WalletConnectRelay | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import TestingUtils | ||
@testable import Web3Modal | ||
import XCTest | ||
|
||
final class ExplorerAPITests: XCTestCase { | ||
|
||
func testCorrectUserAgent() throws { | ||
|
||
let request = ExplorerAPI | ||
.getListings(projectId: "foo", metadata: .stub()) | ||
.resolve(for: "www.google.com") | ||
|
||
XCTAssertEqual(request?.allHTTPHeaderFields?["Referer"], "Wallet Connect") | ||
// Should look something like this: w3m-ios-1.0.0/swift-v1.6.8/iOS-16.1 | ||
XCTAssertTrue(request?.allHTTPHeaderFields?["User-Agent"]?.starts(with: "w3m-ios-1.0.0/swift-v") ?? false) | ||
} | ||
} |