Skip to content

routing.RequestRedirect.get_response : environ parameter is required #1718

@Nurbel

Description

@Nurbel

I tried out the generic HTTPException handler described in:
https://flask.palletsprojects.com/en/1.1.x/errorhandling/#generic-exception-handlers

this handler calls get_response() without parameter on the error, but it breaks on a RequestRedirect as the environ parameter is required.

Is there a reason why RequestRedirect does not conform to the HTTPException signature for get_response ?

I think

def get_response(self, environ):
    return redirect(self.new_url, self.code)

should be replaced by

def get_response(self, environ=None):
    return redirect(self.new_url, self.code)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions