Skip to content

Commit

Permalink
Merge pull request #570 from vonox7/patch-1
Browse files Browse the repository at this point in the history
Add onHttpResponseHeaders callback. Fixes #567
  • Loading branch information
fassko authored Oct 8, 2018
2 parents 82a0121 + 46d8cac commit 0f18ae5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Starscream/WebSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ open class WebSocket : NSObject, StreamDelegate, WebSocketClient, WSStreamDelega
public var onText: ((String) -> Void)?
public var onData: ((Data) -> Void)?
public var onPong: ((Data?) -> Void)?
public var onHttpResponseHeaders: (([String: String]) -> Void)?

public var disableSSLCertValidation = false
public var overrideTrustHostname = false
Expand Down Expand Up @@ -876,6 +877,7 @@ open class WebSocket : NSObject, StreamDelegate, WebSocketClient, WSStreamDelega
i += 1
}
advancedDelegate?.websocketHttpUpgrade(socket: self, response: str)
onHttpResponseHeaders?(headers)
if code != httpSwitchProtocolCode {
return code
}
Expand Down

0 comments on commit 0f18ae5

Please sign in to comment.