Skip to content

Commit

Permalink
Merge pull request #25 from wescravens/issue-24
Browse files Browse the repository at this point in the history
Fixes #24: Updated hostnameFromUrl function to correctly prepend protocol
  • Loading branch information
echenley committed Dec 3, 2015
2 parents a06ab16 + 202f951 commit f49777e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/util/hostNameFromUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

export default function hostnameFromUrl(str: string): string {
let url = document.createElement('a');
url.href = /^(f|ht)tps?:\/\//i.test(url) ? 'http://' + str : str;
url.href = /^(f|ht)tps?:\/\//i.test(str) ? str : 'http://' + str;
return url.hostname;
}

0 comments on commit f49777e

Please sign in to comment.