From f6f7ac4434675080a0e83cfd0f144b1a90970ecf Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Wed, 3 Jan 2024 15:51:40 +0100 Subject: [PATCH] Allow calculations in the address bar (#2012) Task/Issue URL: https://app.asana.com/0/0/1206262563462715/f Description: Treat strings like "1.4" in address bar as search queries, not as IPs (1.0.0.4). --- DuckDuckGo.xcodeproj/project.pbxproj | 6 +++--- .../xcshareddata/swiftpm/Package.resolved | 6 +++--- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/LoginItems/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/PixelKit/Package.swift | 2 +- LocalPackages/Subscription/Package.swift | 2 +- LocalPackages/SwiftUIExtensions/Package.swift | 2 +- LocalPackages/SyncUI/Package.swift | 2 +- LocalPackages/SystemExtensionManager/Package.swift | 2 +- LocalPackages/XPCHelper/Package.swift | 2 +- UnitTests/Common/Extensions/URLExtensionTests.swift | 3 ++- 12 files changed, 17 insertions(+), 16 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index ab5be088cd..84a726a4ab 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -13058,7 +13058,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 100.0.1; + version = 100.0.2; }; }; AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = { @@ -13073,8 +13073,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing"; requirement = { - kind = upToNextMajorVersion; - minimumVersion = 1.15.1; + kind = exactVersion; + version = 1.15.1; }; }; B6DA44152616C13800DD1EC2 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 969ad6baa7..dc69a3be2c 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "e9c344c15d550112d02853c07efeaa154e911e2b", - "version" : "100.0.1" + "revision" : "39a5daf268f9fcb57d95e6193eca20f7ea222de6", + "version" : "100.0.2" } }, { @@ -147,7 +147,7 @@ { "identity" : "trackerradarkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/duckduckgo/TrackerRadarKit", + "location" : "https://github.com/duckduckgo/TrackerRadarKit.git", "state" : { "revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff", "version" : "1.2.2" diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 3abf018187..1d0642ebed 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), .package(path: "../PixelKit"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper") diff --git a/LocalPackages/LoginItems/Package.swift b/LocalPackages/LoginItems/Package.swift index 420d1a83df..6a680264a2 100644 --- a/LocalPackages/LoginItems/Package.swift +++ b/LocalPackages/LoginItems/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), ], targets: [ .target( diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 8e0d381d15..02e27cdd4a 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions") ], diff --git a/LocalPackages/PixelKit/Package.swift b/LocalPackages/PixelKit/Package.swift index 1693459665..c705817c5c 100644 --- a/LocalPackages/PixelKit/Package.swift +++ b/LocalPackages/PixelKit/Package.swift @@ -20,7 +20,7 @@ let package = Package( ) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), ], targets: [ .target( diff --git a/LocalPackages/Subscription/Package.swift b/LocalPackages/Subscription/Package.swift index e1c6e0ce55..e3e656a065 100644 --- a/LocalPackages/Subscription/Package.swift +++ b/LocalPackages/Subscription/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["Subscription"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), ], targets: [ .target( diff --git a/LocalPackages/SwiftUIExtensions/Package.swift b/LocalPackages/SwiftUIExtensions/Package.swift index be79cb57de..ec4f316266 100644 --- a/LocalPackages/SwiftUIExtensions/Package.swift +++ b/LocalPackages/SwiftUIExtensions/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), ], targets: [ .target( diff --git a/LocalPackages/SyncUI/Package.swift b/LocalPackages/SyncUI/Package.swift index 54387b5708..10c236e6be 100644 --- a/LocalPackages/SyncUI/Package.swift +++ b/LocalPackages/SyncUI/Package.swift @@ -13,7 +13,7 @@ let package = Package( ], dependencies: [ .package(path: "../SwiftUIExtensions"), - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), ], targets: [ .target( diff --git a/LocalPackages/SystemExtensionManager/Package.swift b/LocalPackages/SystemExtensionManager/Package.swift index 84877739d9..952f6c5a81 100644 --- a/LocalPackages/SystemExtensionManager/Package.swift +++ b/LocalPackages/SystemExtensionManager/Package.swift @@ -16,7 +16,7 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/LocalPackages/XPCHelper/Package.swift b/LocalPackages/XPCHelper/Package.swift index 35cee5f1f1..dc1abf06dc 100644 --- a/LocalPackages/XPCHelper/Package.swift +++ b/LocalPackages/XPCHelper/Package.swift @@ -30,7 +30,7 @@ let package = Package( .library(name: "XPCHelper", targets: ["XPCHelper"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.1"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "100.0.2"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. diff --git a/UnitTests/Common/Extensions/URLExtensionTests.swift b/UnitTests/Common/Extensions/URLExtensionTests.swift index a0a6494045..c2ccbdf375 100644 --- a/UnitTests/Common/Extensions/URLExtensionTests.swift +++ b/UnitTests/Common/Extensions/URLExtensionTests.swift @@ -56,7 +56,8 @@ final class URLExtensionTests: XCTestCase { ("test string with spaces", "https://duckduckgo.com/?q=test%20string%20with%20spaces"), ("http://💩.la:8080 ", "http://xn--ls8h.la:8080"), ("http:// 💩.la:8080 ", "https://duckduckgo.com/?q=http%3A%2F%2F%20%F0%9F%92%A9.la%3A8080"), - ("https://xn--ls8h.la/path/to/resource", "https://xn--ls8h.la/path/to/resource") + ("https://xn--ls8h.la/path/to/resource", "https://xn--ls8h.la/path/to/resource"), + ("1.4/3.4", "https://duckduckgo.com/?q=1.4%2F3.4") ] for (string, expected) in data {