mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Fix sanitizeURL (#599)
This commit is contained in:
@@ -119,11 +119,11 @@ const sanitiseURL = (url?: string, siteURL?: URL) => {
|
|||||||
if (siteURL) {
|
if (siteURL) {
|
||||||
// if url starts with the site host, then prepend the protocol
|
// if url starts with the site host, then prepend the protocol
|
||||||
if (url.startsWith(siteURL.host)) {
|
if (url.startsWith(siteURL.host)) {
|
||||||
return siteURL.protocol + url;
|
return `${siteURL.protocol}//${url}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, construct the url from the protocol, host and passed 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
|
// just prepend the protocol - assume https
|
||||||
|
|||||||
Reference in New Issue
Block a user