Use +[RCTConvert NSURL:] everywhere instead of +[NSURL URLWithString:]

Summary:
RCTConvert's URL: method gracefully handles unescaped urls, local file urls, urls containing unicode, etc. URLWithString doesn't.
This commit is contained in:
Nick Lockwood
2015-08-04 16:18:44 -07:00
parent 222594cb44
commit f165bbaf4e
5 changed files with 13 additions and 10 deletions

View File

@@ -13,6 +13,7 @@
#import "RCTWebSocketExecutor.h"
#import "RCTConvert.h"
#import "RCTLog.h"
#import "RCTSparseArray.h"
#import "RCTUtils.h"
@@ -38,7 +39,7 @@ RCT_EXPORT_MODULE()
- (instancetype)init
{
return [self initWithURL:[NSURL URLWithString:@"http://localhost:8081/debugger-proxy"]];
return [self initWithURL:[RCTConvert NSURL:@"http://localhost:8081/debugger-proxy"]];
}
- (instancetype)initWithURL:(NSURL *)URL