Skip to content

Commit b1debdf

Browse files
committed
bump ws, fix #598
1 parent 077de02 commit b1debdf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Source/SSLSecurity.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public protocol SSLTrustValidator {
2626
func isValid(_ trust: SecTrust, domain: String?) -> Bool
2727
}
2828

29-
open class SSLCert {
29+
open class SSLCert : NSObject {
3030
var certData: Data?
3131
var key: SecKey?
3232

Source/WebSocket.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ open class WebSocket : NSObject, StreamDelegate {
162162
public init(url: URL, protocols: [String]? = nil) {
163163
self.url = url
164164
self.origin = url.absoluteString
165+
if let hostUrl = URL (string: "/", relativeTo: url) {
166+
var origin = hostUrl.absoluteString
167+
origin.remove(at: origin.index(before: origin.endIndex))
168+
self.origin = origin
169+
}
165170
writeQueue.maxConcurrentOperationCount = 1
166171
optionalProtocols = protocols
167172
}

0 commit comments

Comments
 (0)