Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP alterations in SDLURLSession to use NSURLComponents #436

Merged
merged 5 commits into from Aug 18, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions SmartDeviceLink/SDLURLSession.m
Expand Up @@ -64,7 +64,7 @@ - (instancetype)init {
- (void)dataFromURL:(NSURL *)url completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler {
// Apple no longer allows HTTP URLs without a special exception as of Jan. 2017
if ([url.scheme isEqualToString:@"http"]) {
url = [NSURL URLWithString:[url.absoluteString stringByReplacingOccurrencesOfString:@"http://" withString:@"https://"]];
url = [NSURL URLWithString:[url.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary space here.

}

NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:self.cachePolicy timeoutInterval:self.connectionTimeout];
Expand All @@ -78,7 +78,7 @@ - (void)dataFromURL:(NSURL *)url completionHandler:(SDLURLConnectionRequestCompl
- (void)uploadWithURLRequest:(NSURLRequest *)request data:(NSData *)data completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler {
NSURL *newURL = nil;
if ([request.URL.scheme isEqualToString:@"http"]) {
newURL = [NSURL URLWithString:[request.URL.absoluteString stringByReplacingOccurrencesOfString:@"http://" withString:@"https://"]];
newURL = [NSURL URLWithString:[request.URL.absoluteString stringByReplacingCharactersInRange:NSMakeRange(0, 4) withString:@"https"]];
}

NSMutableURLRequest *mutableRequest = [request mutableCopy];
Expand Down