File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -620,9 +620,12 @@ open class PusherConnection: NSObject {
620
620
- returns: URLRequest object to be used by the function making the auth request
621
621
*/
622
622
fileprivate func requestForAuthValue( from endpoint: String , socketID: String , channel: PusherChannel ) -> URLRequest {
623
+ let allowedCharacterSet = CharacterSet ( charactersIn: " !*'();:@&=+$,/?%#[] " ) . inverted
624
+ let encodedChannelName = channel. name. addingPercentEncoding ( withAllowedCharacters: allowedCharacterSet)
625
+
623
626
var request = URLRequest ( url: URL ( string: endpoint) !)
624
627
request. httpMethod = " POST "
625
- request. httpBody = " socket_id= \( socketID) &channel_name= \( channel . name ) " . data ( using: String . Encoding. utf8)
628
+ request. httpBody = " socket_id= \( socketID) &channel_name= \( encodedChannelName! ) " . data ( using: String . Encoding. utf8)
626
629
627
630
return request
628
631
}
You can’t perform that action at this time.
0 commit comments