fix: normalize server name

This commit is contained in:
Anthony Fu 2022-12-24 01:51:45 +01:00
parent fdf2d75d86
commit 32f22f81d9
4 changed files with 6 additions and 4 deletions

View file

@ -110,7 +110,7 @@ onMounted(async () => {
<div
absolute left-6em right-0 top="100%"
bg-base rounded border="~ base"
text-left
text-left z-10 shadow
>
<div
v-for="server, idx in filteredServers"

View file

@ -3,7 +3,8 @@ import { createError, defineEventHandler, getRouterParams } from 'h3'
import { getApp, getRedirectURI } from '~/server/shared'
export default defineEventHandler(async (event) => {
const { server } = getRouterParams(event)
let { server } = getRouterParams(event)
server = server.toLocaleLowerCase().trim()
const app = await getApp(server)
if (!app) {

View file

@ -3,7 +3,8 @@ import { createError, defineEventHandler, getQuery, getRouterParams, sendRedirec
import { getApp, getRedirectURI } from '~/server/shared'
export default defineEventHandler(async (event) => {
const { server } = getRouterParams(event)
let { server } = getRouterParams(event)
server = server.toLocaleLowerCase().trim()
const app = await getApp(server)
if (!app) {

View file

@ -73,7 +73,7 @@ export async function listServers() {
continue
const id = key.split(':').pop()!.replace(/\.json$/, '')
if (id)
servers.add(id)
servers.add(id.toLocaleLowerCase())
}
return Array.from(servers).sort()
}