From 64cd11377ed9c9e9cfe1c486f8f300e6d89c64cb Mon Sep 17 00:00:00 2001 From: justcool393 Date: Tue, 11 Oct 2022 04:49:22 -0700 Subject: [PATCH] fix 500 werkzeug description, add note, and remove unused import --- files/routes/errors.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/files/routes/errors.py b/files/routes/errors.py index 5e59fd708..c6db0855b 100644 --- a/files/routes/errors.py +++ b/files/routes/errors.py @@ -1,10 +1,14 @@ from files.helpers.wrappers import * from flask import * -from werkzeug.exceptions import HTTPException from urllib.parse import quote, urlencode import time from files.__main__ import app, limiter +# If you're adding an error, go here: +# https://github.com/pallets/werkzeug/blob/main/src/werkzeug/exceptions.py +# and copy the description for the error code you're adding so that the +# default error message doesn't show up on the message. Please be exact. + WERKZEUG_ERROR_DESCRIPTIONS = { 400: "The browser (or proxy) sent a request that this server could not understand.", 401: "The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.", @@ -18,7 +22,7 @@ WERKZEUG_ERROR_DESCRIPTIONS = { 417: "The server could not meet the requirements of the Expect header", 418: "This server is a teapot, not a coffee machine", 429: "This user has exceeded an allotted request count. Try again later.", - 500: "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.", + 500: "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.", } ERROR_TITLES = {