Skip to content

Commit 984998f

Browse files
author
Pierre Rougeot
committed
git maintenance
1 parent 96975b8 commit 984998f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

UrlShortener/UrlShortener.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ - (void)shortenUrl:(NSString *)longUrl withService:(UrlShortenerService)service
6969
NSMutableURLRequest *request;
7070
if (service == UrlShortenerServiceRedirect) {
7171
NSString *endPoint = [NSString stringWithFormat:REDIRECT_URL, encodedUrl, APP_NAME];
72-
request = [NSURLRequest requestWithURL:[NSURL URLWithString:endPoint]];
72+
request = [[NSURLRequest requestWithURL:[NSURL URLWithString:endPoint]] mutableCopy];
7373
}
7474
else if (service == UrlShortenerServiceGoogle) {
7575
request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.googleapis.com/urlshortener/v1/url"]
@@ -81,15 +81,15 @@ - (void)shortenUrl:(NSString *)longUrl withService:(UrlShortenerService)service
8181
}
8282
else if (service == UrlShortenerServiceIsgd) {
8383
NSString *endPoint = [NSString stringWithFormat:ISGD_URL, encodedUrl];
84-
request = [NSURLRequest requestWithURL:[NSURL URLWithString:endPoint]];
84+
request = [[NSURLRequest requestWithURL:[NSURL URLWithString:endPoint]] mutableCopy];
8585
}
8686
else if (service == UrlShortenerServiceJmp) {
8787
NSString *endPoint = [NSString stringWithFormat:JMP_URL, encodedUrl, BITLY_APIKEY, BITLY_LOGIN];
88-
request = [NSURLRequest requestWithURL:[NSURL URLWithString:endPoint]];
88+
request = [[NSURLRequest requestWithURL:[NSURL URLWithString:endPoint]] mutableCopy];
8989
}
9090
else {
9191
NSString *endPoint = [NSString stringWithFormat:BITLY_URL, encodedUrl, BITLY_APIKEY, BITLY_LOGIN];
92-
request = [NSURLRequest requestWithURL:[NSURL URLWithString:endPoint]];
92+
request = [[NSURLRequest requestWithURL:[NSURL URLWithString:endPoint]] mutableCopy];
9393
}
9494
[NSURLConnection connectionWithRequest:request delegate:self];
9595
}

0 commit comments

Comments
 (0)