Skip to content

Commit

Permalink
update name to userAgentComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsphaxer committed Jan 26, 2025
1 parent 2b7a713 commit 8862324
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/HotwireConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public struct HotwireConfig {

/// Getter for user-agent string
/// - returns: "`applicationUserAgentPrefix`; Native iOS; Turbo Native iOS; bridge-components: [your bridge components];"
public var userAgent: String {
public var userAgentComponent: String {
get {
return UserAgent.build(
applicationPrefix: applicationUserAgentPrefix,
Expand Down Expand Up @@ -96,7 +96,7 @@ public struct HotwireConfig {
private func makeWebViewConfiguration() -> WKWebViewConfiguration {
let configuration = WKWebViewConfiguration()
configuration.defaultWebpagePreferences?.preferredContentMode = .mobile
configuration.applicationNameForUserAgent = userAgent
configuration.applicationNameForUserAgent = userAgentComponent
configuration.processPool = sharedProcessPool
return configuration
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Turbo/HotwireConfigTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class HotwireConfigTests: XCTestCase {
let testComponent = MockBridgeComponent.self
Hotwire.registerBridgeComponents([testComponent])

XCTAssertEqual(config.userAgent, "TestApp/1.0 Hotwire Native iOS; Turbo Native iOS; bridge-components: [MockComponent]")
XCTAssertEqual(config.userAgentComponent, "TestApp/1.0 Hotwire Native iOS; Turbo Native iOS; bridge-components: [MockComponent]")
}
}

Expand Down

0 comments on commit 8862324

Please sign in to comment.