mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-01 18:31:35 +00:00
FIx infinite loop
This commit is contained in:
parent
4e6ddcbcc8
commit
6a29419bff
3 changed files with 5 additions and 5 deletions
|
|
@ -2,9 +2,9 @@ const {render} = require("pinski/plugins")
|
|||
const constants = require("../../lib/constants")
|
||||
|
||||
module.exports = [
|
||||
{route: "/404", methods: ["GET", "POST", "PATCH", "DELETE"], code: async ({url}) => {
|
||||
{route: "/404", methods: ["*"], code: async ({url}) => {
|
||||
const path = url.searchParams.get("pathname")
|
||||
const couldBeUsername = path.match(`^/${constants.external.username_regex}$`)
|
||||
const couldBeUsername = path && path.match(`^/${constants.external.username_regex}(?:/channel)?$`)
|
||||
return render(404, "pug/404.pug", {path, couldBeUsername})
|
||||
}}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue