Inspector crashes when a device name contained spaces

Reviewed By: Hypuk

Differential Revision: D5434498

fbshipit-source-id: f758497ca50e4c02e436812725acfe0dcb8428b4
This commit is contained in:
Paco Estevez Garcia 2017-07-18 10:51:47 -07:00 committed by Facebook Github Bot
parent e5e9cab8ed
commit 9df79e7e96
1 changed files with 2 additions and 1 deletions

View File

@ -30,9 +30,10 @@ static NSString *getDebugServerHost(NSURL *bundleURL)
static NSURL *getInspectorDeviceUrl(NSURL *bundleURL)
{
NSString *escapedText = [[[UIDevice currentDevice] name] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@",
getDebugServerHost(bundleURL),
[[UIDevice currentDevice] name]]];
escapedText]];
}