Skip to content

Commit e615ca9

Browse files
committed
Only accept 200 or 201 status code in auth request responses
1 parent 5cd469c commit e615ca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/PusherConnection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ open class PusherConnection: NSObject {
617617
return
618618
}
619619

620-
guard let httpResponse = response as? HTTPURLResponse, (httpResponse.statusCode >= 200 && httpResponse.statusCode < 300) else {
620+
guard let httpResponse = response as? HTTPURLResponse, (httpResponse.statusCode == 200 || httpResponse.statusCode == 201) else {
621621
let dataString = String(data: data, encoding: String.Encoding.utf8)
622622
print ("Error authorizing channel [\(channel.name)]: \(dataString)")
623623
self.handleAuthorizationError(forChannel: channel.name, response: response, data: dataString, error: nil)

0 commit comments

Comments
 (0)