diff --git a/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlData.swift b/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlData.swift index 86a792370..c49363e5f 100644 --- a/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlData.swift +++ b/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlData.swift @@ -148,7 +148,7 @@ extension EnvironmentUrlData { api: URL(string: "https://api.bitwarden.eu")!, base: URL(string: "https://vault.bitwarden.eu")!, events: URL(string: "https://events.bitwarden.eu")!, - icons: URL(string: "https://icons.bitwarden.net")!, + icons: URL(string: "https://icons.bitwarden.eu")!, identity: URL(string: "https://identity.bitwarden.eu")!, notifications: URL(string: "https://notifications.bitwarden.eu")!, webVault: URL(string: "https://vault.bitwarden.eu")! diff --git a/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlDataTests.swift b/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlDataTests.swift index 171bf0f56..b3e0c78e9 100644 --- a/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlDataTests.swift +++ b/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlDataTests.swift @@ -31,7 +31,7 @@ class EnvironmentUrlDataTests: XCTestCase { api: URL(string: "https://api.bitwarden.eu")!, base: URL(string: "https://vault.bitwarden.eu")!, events: URL(string: "https://events.bitwarden.eu")!, - icons: URL(string: "https://icons.bitwarden.net")!, + icons: URL(string: "https://icons.bitwarden.eu")!, identity: URL(string: "https://identity.bitwarden.eu")!, notifications: URL(string: "https://notifications.bitwarden.eu")!, webVault: URL(string: "https://vault.bitwarden.eu")! diff --git a/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlsTests.swift b/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlsTests.swift index 150fe71c8..60df7b966 100644 --- a/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlsTests.swift +++ b/BitwardenShared/Core/Platform/Models/Domain/EnvironmentUrlsTests.swift @@ -38,7 +38,7 @@ class EnvironmentUrlsTests: BitwardenTestCase { apiURL: URL(string: "https://api.bitwarden.eu")!, baseURL: URL(string: "https://vault.bitwarden.eu")!, eventsURL: URL(string: "https://events.bitwarden.eu")!, - iconsURL: URL(string: "https://icons.bitwarden.net")!, + iconsURL: URL(string: "https://icons.bitwarden.eu")!, identityURL: URL(string: "https://identity.bitwarden.eu")!, importItemsURL: URL(string: "https://vault.bitwarden.eu/#/tools/import")!, recoveryCodeURL: URL(string: "https://vault.bitwarden.eu/#/recover-2fa")!, diff --git a/BitwardenShared/Core/Platform/Services/EnvironmentServiceTests.swift b/BitwardenShared/Core/Platform/Services/EnvironmentServiceTests.swift index 6844ce4b5..1b23b1f59 100644 --- a/BitwardenShared/Core/Platform/Services/EnvironmentServiceTests.swift +++ b/BitwardenShared/Core/Platform/Services/EnvironmentServiceTests.swift @@ -79,7 +79,7 @@ class EnvironmentServiceTests: XCTestCase { XCTAssertEqual(subject.apiURL, URL(string: "https://api.bitwarden.eu")) XCTAssertEqual(subject.eventsURL, URL(string: "https://events.bitwarden.eu")) - XCTAssertEqual(subject.iconsURL, URL(string: "https://icons.bitwarden.net")) + XCTAssertEqual(subject.iconsURL, URL(string: "https://icons.bitwarden.eu")) XCTAssertEqual(subject.identityURL, URL(string: "https://identity.bitwarden.eu")) XCTAssertEqual(subject.importItemsURL, URL(string: "https://vault.bitwarden.eu/#/tools/import")) XCTAssertEqual(subject.region, .europe) diff --git a/BitwardenShared/Core/Tools/Repositories/SendRepository.swift b/BitwardenShared/Core/Tools/Repositories/SendRepository.swift index 3f22be95c..336aab130 100644 --- a/BitwardenShared/Core/Tools/Repositories/SendRepository.swift +++ b/BitwardenShared/Core/Tools/Repositories/SendRepository.swift @@ -199,8 +199,12 @@ class DefaultSendRepository: SendRepository { func shareURL(for sendView: SendView) async throws -> URL? { guard let accessId = sendView.accessId, let key = sendView.key else { return nil } - let sharePath = "/\(accessId)/\(key)" - let url = URL(string: environmentService.sendShareURL.absoluteString.appending(sharePath)) + let sharePath = "\(accessId)/\(key)" + var sendShareUrlString = environmentService.sendShareURL.absoluteString + if !sendShareUrlString.hasSuffix("#") { + sendShareUrlString = sendShareUrlString.appending("/") + } + let url = URL(string: sendShareUrlString.appending(sharePath)) return url } diff --git a/BitwardenShared/Core/Tools/Repositories/SendRepositoryTests.swift b/BitwardenShared/Core/Tools/Repositories/SendRepositoryTests.swift index a6b86e73b..e1d949416 100644 --- a/BitwardenShared/Core/Tools/Repositories/SendRepositoryTests.swift +++ b/BitwardenShared/Core/Tools/Repositories/SendRepositoryTests.swift @@ -344,12 +344,20 @@ class SendRepositoryTests: BitwardenTestCase { // swiftlint:disable:this type_bo /// `shareURL()` successfully generates a share url for the send view. func test_shareURL() async throws { let sendView = SendView.fixture(accessId: "ACCESS_ID", key: "KEY") - environmentService.webVaultURL = .example let url = try await subject.shareURL(for: sendView) XCTAssertEqual(url?.absoluteString, "https://example.com/#/send/ACCESS_ID/KEY") } + /// `shareURL()` successfully generates a share url for the send view when the `sendShareURL` ends with a "#". + func test_shareURL_poundSignSuffix() async throws { + let sendView = SendView.fixture(accessId: "ACCESS_ID", key: "KEY") + environmentService.sendShareURL = URL(string: "https://send.bitwarden.com/#")! + let url = try await subject.shareURL(for: sendView) + + XCTAssertEqual(url?.absoluteString, "https://send.bitwarden.com/#ACCESS_ID/KEY") + } + /// `updateSend()` successfully encrypts the send view and uses the send service to update it. func test_updateSend() async throws { let sendResult = Send.fixture(id: "SEND_ID")