Skip to content

before_request functions not run before every request #291

Closed
@jab

Description

@jab

I have a before_request function which I'd like to be actually run before every request. It sets some variables on g based on things like headers that I would like a custom error handler to be able to access. If I e.g. abort(404) from one of my own views, I'm fine, but if a request comes in that werkzeug can determine has no matching route, it bypasses my before_request function and goes straight to the error handler, so g is missing info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions