chore: pre-check if slug is same before and after lowercase.
This commit is contained in:
parent
902fc1bef5
commit
899323faf6
1 changed files with 3 additions and 2 deletions
|
|
@ -20,8 +20,9 @@ export default eventHandler(async (event) => {
|
|||
await KV.get(`link:${key}`, { type: 'json', cacheTtl: linkCacheTtl })
|
||||
|
||||
link = await getLink(slug)
|
||||
if (!caseSensitive && !link) {
|
||||
link = await getLink(slug.toLowerCase())
|
||||
const lowercaseSlug = slug.toLowerCase()
|
||||
if (!caseSensitive && !link && lowercaseSlug !== slug) {
|
||||
link = await getLink(lowercaseSlug)
|
||||
}
|
||||
|
||||
if (link) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue