[RN] Strip spaces when parsing URLs

This commit is contained in:
Saúl Ibarra Corretgé 2018-01-15 14:21:50 +01:00 committed by Lyubo Marinov
parent bdf2ecfe4b
commit a23eec55e8
1 changed files with 3 additions and 0 deletions

View File

@ -177,6 +177,9 @@ export function parseStandardURIString(str: string) {
let regex; let regex;
let match: Array<string> | null; let match: Array<string> | null;
// cleanup spaces
str = str.replace(/\s/g, '');
// protocol // protocol
regex = new RegExp(`^${_URI_PROTOCOL_PATTERN}`, 'gi'); regex = new RegExp(`^${_URI_PROTOCOL_PATTERN}`, 'gi');
match = regex.exec(str); match = regex.exec(str);