Making sure URLs are always lower-case.

This commit is contained in:
mike12345567 2021-01-14 17:31:17 +00:00
parent cfe3c6e3d2
commit d820e3287e
3 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@
} }
async function checkUrl(url) { async function checkUrl(url) {
urlError = await checkValidation({ url }, urlValidation) urlError = await checkValidation({ url: url.toLowerCase() }, urlValidation)
} }
onMount(async () => { onMount(async () => {

View File

@ -72,7 +72,7 @@ async function getAppUrlIfNotInUse(ctx) {
} else { } else {
url = encodeURI(`${ctx.request.body.name}`) url = encodeURI(`${ctx.request.body.name}`)
} }
url = `/${url.replace(/\/|\\/g, "")}` url = `/${url.replace(/\/|\\/g, "")}`.toLowerCase()
const hostingInfo = await getHostingInfo() const hostingInfo = await getHostingInfo()
if (hostingInfo.type === HostingTypes.CLOUD) { if (hostingInfo.type === HostingTypes.CLOUD) {
return url return url

View File

@ -29,7 +29,7 @@ function objectStoreUrl() {
async function checkForSelfHostedURL(ctx) { async function checkForSelfHostedURL(ctx) {
// the "appId" component of the URL may actually be a specific self hosted URL // the "appId" component of the URL may actually be a specific self hosted URL
let possibleAppUrl = `/${encodeURI(ctx.params.appId)}` let possibleAppUrl = `/${encodeURI(ctx.params.appId).toLowerCase()}`
const apps = await getDeployedApps() const apps = await getDeployedApps()
if (apps[possibleAppUrl] && apps[possibleAppUrl].appId) { if (apps[possibleAppUrl] && apps[possibleAppUrl].appId) {
return apps[possibleAppUrl].appId return apps[possibleAppUrl].appId