Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Nurbel opened this issue Feb 7, 2020 · 1 comment · Fixed by #1719
Closed

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

Nurbel opened this issue Feb 7, 2020 · 1 comment · Fixed by #1719
Milestone

Comments

@Nurbel
Copy link

@Nurbel Nurbel commented Feb 7, 2020

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)
@Nurbel Nurbel changed the title RequestsRedirect.get_response : environ parameter is required routing.RequestRedirect.get_response : environ parameter is required Feb 7, 2020
@pgjones
Copy link
Member

@pgjones pgjones commented Feb 7, 2020

This makes sense to me, see #1719.

@davidism davidism added this to the 1.0.1 milestone Feb 9, 2020
@pgjones pgjones closed this as completed Feb 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants