Skip to content

Commit

Permalink
Fix sanitizeURL (#599)
Browse files Browse the repository at this point in the history
  • Loading branch information
peolic authored Jun 10, 2020
1 parent bd5ee9b commit ef8cba8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/v2.5/src/utils/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ const sanitiseURL = (url?: string, siteURL?: URL) => {
if (siteURL) {
// if url starts with the site host, then prepend the protocol
if (url.startsWith(siteURL.host)) {
return siteURL.protocol + url;
return `${siteURL.protocol}//${url}`;
}

// otherwise, construct the url from the protocol, host and passed url
return `${siteURL.protocol}${siteURL.host}/${url}`;
return `${siteURL.protocol}//${siteURL.host}/${url}`;
}

// just prepend the protocol - assume https
Expand Down

0 comments on commit ef8cba8

Please sign in to comment.