From 77cfa27615814d6a5d5d774e74b044d899dda238 Mon Sep 17 00:00:00 2001 From: stringsplit <77242831+nbitzz@users.noreply.github.com> Date: Wed, 27 Mar 2024 11:52:42 -0700 Subject: [PATCH] real quick; i'll port more stuff over later... --- src/server/lib/errors.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/lib/errors.ts b/src/server/lib/errors.ts index f2d3615..4069982 100644 --- a/src/server/lib/errors.ts +++ b/src/server/lib/errors.ts @@ -24,13 +24,13 @@ export default async function ServeError( // serve error - return ctx.html( + return ctx.req.header("accept").includes("text/html") ? ctx.html( errorPage .replaceAll("$code", code.toString()) .replaceAll("$text", reason), - code as StatusCode, + code as StatusCode/*, { "x-backup-status-message": reason, // glitch default nginx configuration - } - ) + }*/ + ) : ctx.text(reason, code as StatusCode) }