You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some debugging I've found that the headers setter is calling the getter which calls a dynamic getter and ignores the new values
This declaration
open var headers : [String: String]? {
get { return socket.request.allHTTPHeaderFields }
set {
for (field, value) in headers ?? [:] {
socket.request.setValue(value, forHTTPHeaderField: field)
}
}
}
Should be replaced with this
open var headers : [String: String]? {
get { return socket.request.allHTTPHeaderFields }
set {
for (field, value) in newValue ?? [:] {
socket.request.setValue(value, forHTTPHeaderField: field)
}
}
}
After more headscreatching I've found another problem with variable names.
My server handles authentication via the Authorization header and it rejects the connection if the token is not right. But for some reason the client never got the message and kept retrying
After some debugging I've found that the
headers
setter is calling the getter which calls a dynamic getter and ignores the new valuesThis declaration
Should be replaced with this
If you need a test just run this example
https://github.com/danielrhodes/Swift-ActionCableClient/blob/master/Source/Classes/ActionCableClient.swift#L77
The text was updated successfully, but these errors were encountered: