Apply settings to error pages
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
const {render} = require("pinski/plugins")
|
||||
const constants = require("../../lib/constants")
|
||||
const {getSettings} = require("./utils/getsettings")
|
||||
|
||||
module.exports = [
|
||||
{route: "/404", methods: ["*"], code: async ({url}) => {
|
||||
{route: "/404", methods: ["*"], code: async ({req, url}) => {
|
||||
const path = url.searchParams.get("pathname")
|
||||
const couldBeUsername = path && path.match(`^/${constants.external.username_regex}(?:/channel)?$`)
|
||||
return render(404, "pug/404.pug", {path, couldBeUsername})
|
||||
const settings = getSettings(req)
|
||||
return render(404, "pug/404.pug", {settings, path, couldBeUsername})
|
||||
}}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user