Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
add http protocol if none fiven
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Mar 2, 2018
1 parent f205a9c commit 0d80216
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/services/utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ export class UtilsService implements UtilsServiceAbstraction {
return null;
}

if (uriString.indexOf('://') === -1) {
uriString = 'http://' + uriString;
}

if (uriString.startsWith('http://') || uriString.startsWith('https://')) {
try {
return new URL(uriString);
Expand Down

0 comments on commit 0d80216

Please sign in to comment.