Skip to content

Commit

Permalink
startsWith is fucked up in RN facebook/react-native#11370
Browse files Browse the repository at this point in the history
  • Loading branch information
no committed Jan 7, 2019
1 parent ea129a5 commit 59a97b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/kalama-api/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ export interface SearchResult {

const normalizeUrl = (url: string): string => {
const _url = url.trim();
if (_url.startsWith('http://') || _url.startsWith('https://')) {
//Not using startsWith here becasue of: https://github.com/facebook/react-native/issues/11370
if (_url.indexOf('http://') === 0 || _url.indexOf('https://') === 0) {
return _url;
}

return `${SERVER_ROOT}${_url}`;
};

Expand Down

0 comments on commit 59a97b8

Please sign in to comment.