@@ -69,7 +69,7 @@ - (void)shortenUrl:(NSString *)longUrl withService:(UrlShortenerService)service
69
69
NSMutableURLRequest *request;
70
70
if (service == UrlShortenerServiceRedirect) {
71
71
NSString *endPoint = [NSString stringWithFormat: REDIRECT_URL, encodedUrl, APP_NAME];
72
- request = [NSURLRequest requestWithURL: [NSURL URLWithString: endPoint]];
72
+ request = [[ NSURLRequest requestWithURL: [NSURL URLWithString: endPoint]] mutableCopy ];
73
73
}
74
74
else if (service == UrlShortenerServiceGoogle) {
75
75
request = [NSMutableURLRequest requestWithURL: [NSURL URLWithString: @" https://www.googleapis.com/urlshortener/v1/url" ]
@@ -81,15 +81,15 @@ - (void)shortenUrl:(NSString *)longUrl withService:(UrlShortenerService)service
81
81
}
82
82
else if (service == UrlShortenerServiceIsgd) {
83
83
NSString *endPoint = [NSString stringWithFormat: ISGD_URL, encodedUrl];
84
- request = [NSURLRequest requestWithURL: [NSURL URLWithString: endPoint]];
84
+ request = [[ NSURLRequest requestWithURL: [NSURL URLWithString: endPoint]] mutableCopy ];
85
85
}
86
86
else if (service == UrlShortenerServiceJmp) {
87
87
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 ];
89
89
}
90
90
else {
91
91
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 ];
93
93
}
94
94
[NSURLConnection connectionWithRequest: request delegate: self ];
95
95
}
0 commit comments