Skip to content

Commit 42358b4

Browse files
Blair McArthurhamchapman
authored andcommitted
Changed a few references to NSURLRequest/NSMutableURLRequest to URLRequest.
1 parent 1b79c41 commit 42358b4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Source/PusherClientOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public enum PusherHost {
1919
}
2020

2121
@objc public protocol AuthRequestBuilderProtocol {
22-
func requestFor(socketID: String, channel: PusherChannel) -> NSMutableURLRequest?
22+
func requestFor(socketID: String, channel: PusherChannel) -> URLRequest?
2323
}
2424

2525
public enum AuthMethod {

Source/PusherConnection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ open class PusherConnection: NSObject {
497497

498498
case .authRequestBuilder(authRequestBuilder: let builder):
499499
if let request = builder.requestFor(socketID: socketID, channel: channel) {
500-
sendAuthorisationRequest(request: request as URLRequest, channel: channel, callback: callback)
500+
sendAuthorisationRequest(request: request, channel: channel, callback: callback)
501501

502502
return true
503503
} else {
@@ -586,7 +586,7 @@ open class PusherConnection: NSObject {
586586
- parameter socketID: The socketId of the connection's websocket
587587
- parameter channel: The PusherChannel to authenticate subsciption for
588588

589-
- returns: NSURLRequest object to be used by the function making the auth request
589+
- returns: URLRequest object to be used by the function making the auth request
590590
*/
591591
fileprivate func requestForAuthValue(from endpoint: String, socketID: String, channel: PusherChannel) -> URLRequest {
592592
var request = URLRequest(url: URL(string: endpoint)!)

Tests/AuthenticationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ class AuthenticationTests: XCTestCase {
111111
func testAuthorizationUsingSomethingConformingToTheAuthRequestBuilderProtocol() {
112112

113113
class AuthRequestBuilder: AuthRequestBuilderProtocol {
114-
func requestFor(socketID: String, channel: PusherChannel) -> NSMutableURLRequest? {
115-
let request = NSMutableURLRequest(url: URL(string: "http://localhost:9292/builder")!)
114+
func requestFor(socketID: String, channel: PusherChannel) -> URLRequest? {
115+
var request = URLRequest(url: URL(string: "http://localhost:9292/builder")!)
116116
request.httpMethod = "POST"
117117
request.httpBody = "socket_id=\(socketID)&channel_name=\(channel.name)".data(using: String.Encoding.utf8)
118118
request.addValue("myToken", forHTTPHeaderField: "Authorization")

0 commit comments

Comments
 (0)