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

Fix HTTPS uploads #438

Merged
merged 2 commits into from Aug 23, 2016
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion SmartDeviceLink/SDLURLSession.m
Expand Up @@ -76,7 +76,7 @@ - (void)dataFromURL:(NSURL *)url completionHandler:(SDLURLConnectionRequestCompl
}

- (void)uploadWithURLRequest:(NSURLRequest *)request data:(NSData *)data completionHandler:(SDLURLConnectionRequestCompletionHandler)completionHandler {
NSURL *newURL = nil;
NSURL *newURL = request.URL;
if ([request.URL.scheme isEqualToString:@"http"]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

check newURL, not the request.

newURL = [NSURL URLWithString:[request.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.

reference newURL's absoluteString.

}
Expand Down
Expand Up @@ -10,7 +10,7 @@
__block SDLURLSession *testSession = nil;

describe(@"attempting to get good data", ^{
context(@"from an http address", ^{
context(@"from an https address", ^{
context(@"uploading data", ^{
NSData *testData = [@"testData" dataUsingEncoding:NSUTF8StringEncoding];
NSArray *someJSONObject = @[@"one", @"two"];
Expand Down