File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ + (NSURL *)NSURL:(id)json
8989
9090 // Check if it has a scheme
9191 if ([path rangeOfString: @" :" ].location != NSNotFound ) {
92- path = [path stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding ];
92+ path = [path stringByAddingPercentEncodingWithAllowedCharacters: NSCharacterSet .URLHostAllowedCharacterSet ];
9393 URL = [NSURL URLWithString: path];
9494 if (URL) {
9595 return URL;
Original file line number Diff line number Diff line change 3131static NSURL *getInspectorDeviceUrl (NSURL *bundleURL)
3232{
3333 NSNumber *inspectorProxyPort = @8082 ;
34- NSString *escapedDeviceName = [[[UIDevice currentDevice ] name ] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding ];
35- NSString *escapedAppName = [[[NSBundle mainBundle ] bundleIdentifier ] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding ];
34+ NSString *escapedDeviceName = [[[UIDevice currentDevice ] name ] stringByAddingPercentEncodingWithAllowedCharacters: NSCharacterSet .URLHostAllowedCharacterSet ];
35+ NSString *escapedAppName = [[[NSBundle mainBundle ] bundleIdentifier ] stringByAddingPercentEncodingWithAllowedCharacters: NSCharacterSet .URLHostAllowedCharacterSet ];
3636 return [NSURL URLWithString: [NSString stringWithFormat: @" http://%@ /inspector/device?name=%@ &app=%@ " ,
3737 getServerHost (bundleURL, inspectorProxyPort),
3838 escapedDeviceName,
4242static NSURL *getAttachDeviceUrl (NSURL *bundleURL, NSString *title)
4343{
4444 NSNumber *metroBundlerPort = @8081 ;
45- NSString *escapedDeviceName = [[[UIDevice currentDevice ] name ] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding ];
46- NSString *escapedAppName = [[[NSBundle mainBundle ] bundleIdentifier ] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding ];
45+ NSString *escapedDeviceName = [[[UIDevice currentDevice ] name ] stringByAddingPercentEncodingWithAllowedCharacters: NSCharacterSet .URLHostAllowedCharacterSet ];
46+ NSString *escapedAppName = [[[NSBundle mainBundle ] bundleIdentifier ] stringByAddingPercentEncodingWithAllowedCharacters: NSCharacterSet .URLHostAllowedCharacterSet ];
4747 return [NSURL URLWithString: [NSString stringWithFormat: @" http://%@ /attach-debugger-nuclide?title=%@ &device=%@ &app=%@ " ,
4848 getServerHost (bundleURL, metroBundlerPort),
4949 title,
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ - (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLR
247247 if (isJSNavigation && [request.URL.host isEqualToString: kPostMessageHost ]) {
248248 NSString *data = request.URL .query ;
249249 data = [data stringByReplacingOccurrencesOfString: @" +" withString: @" " ];
250- data = [data stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding ];
250+ data = [data stringByAddingPercentEncodingWithAllowedCharacters: NSCharacterSet .URLHostAllowedCharacterSet ];
251251
252252 NSMutableDictionary <NSString *, id > *event = [self baseEvent ];
253253 [event addEntriesFromDictionary: @{
You can’t perform that action at this time.
0 commit comments