Closed denisvitez closed 1 year ago
You should be able to disable the automatic 404 help behaviour by setting the RESTX_ERROR_404_HELP
config flag to False:
app = Flask(__name__)
app.config['RESTX_ERROR_404_HELP'] = False
Thank you @peter-doggart this indeed works as advertised :)
While it's great that this behavior can be disabled if needed, since this code path executes when using flask.abort
and the example usage of flask.abort
shows it being passed a flask.Response
, I feel the best thing to do would be to make _help_on_404
support at least that type.
Hello,
in my app, I'm always returning an object (dict) for all 4xx status messages. Since my URL is structured as /controller/entity_id/action I abort for 404, when the entity for the given id is not found in the system. The problem is that for 404 responses this doesn't work, since the library tries to add similar URLs matches to the message, but since my message is actually an object (dict) this causes an exception to occur.
'dict' object has no attribute 'rstrip'
Does anyone know if it's possible to disable these close matches search and automatic message extensions when performing a 404 abort, or in general?