Forráskód Böngészése

Use immutable NSURLRequests when constructing SocketRocket only with URL.

Nikita Lutsenko 9 éve
szülő
commit
9a64f67547
1 módosított fájl, 2 hozzáadás és 3 törlés
  1. 2 3
      SocketRocket/SRWebSocket.m

+ 2 - 3
SocketRocket/SRWebSocket.m

@@ -320,13 +320,12 @@ static __strong NSData *CRLFCRLF;
 
 - (instancetype)initWithURL:(NSURL *)url protocols:(NSArray *)protocols;
 {
-    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];    
-    return [self initWithURLRequest:request protocols:protocols];
+    return [self initWithURL:url protocols:protocols allowsUntrustedSSLCertificates:NO];
 }
 
 - (instancetype)initWithURL:(NSURL *)url protocols:(NSArray *)protocols allowsUntrustedSSLCertificates:(BOOL)allowsUntrustedSSLCertificates
 {
-    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
+    NSURLRequest *request = [NSURLRequest requestWithURL:url];
     return [self initWithURLRequest:request protocols:protocols allowsUntrustedSSLCertificates:allowsUntrustedSSLCertificates];
 }