relays: strip trailing / from relay urls
Fixes: https://github.com/damus-io/damus/issues/1443 Changelog-Fixed: Fix issue with slashes on relay urls causing relay connection problems
This commit is contained in:
28
damusTests/UrlTests.swift
Normal file
28
damusTests/UrlTests.swift
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// UrlTests.swift
|
||||
// damusTests
|
||||
//
|
||||
// Created by William Casarin on 2023-08-06.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import damus
|
||||
|
||||
final class UrlTests: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
func testRelayUrlStripsEndingSlash() throws {
|
||||
let url1 = RelayURL("wss://jb55.com/")!
|
||||
let url2 = RelayURL("wss://jb55.com")!
|
||||
XCTAssertEqual(url1, url2)
|
||||
XCTAssertEqual(url1.url.absoluteString, "wss://jb55.com")
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user