Skip to content

Commit

Permalink
Minor clarity updates to HTTPS alterations
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljfischer committed Aug 23, 2016
1 parent 68b9948 commit 12b1783
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SmartDeviceLink/SDLURLSession.m
Expand Up @@ -76,13 +76,13 @@ - (void)dataFromURL:(NSURL *)url completionHandler:(SDLURLConnectionRequestCompl
}

- (void)uploadWithURLRequest:(NSURLRequest *)request data:(NSData *)data completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler {
NSURL *newURL = request.URL;
if ([request.URL.scheme isEqualToString:@"http"]) {
newURL = [NSURL URLWithString:[request.URL.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]];
NSURL *url = request.URL;
if ([url.scheme isEqualToString:@"http"]) {
url = [NSURL URLWithString:[url.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]];
}

NSMutableURLRequest *mutableRequest = [request mutableCopy];
mutableRequest.URL = newURL;
mutableRequest.URL = url;
mutableRequest.HTTPBody = data;
mutableRequest.HTTPMethod = @"POST";

Expand Down

0 comments on commit 12b1783

Please sign in to comment.