-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Original response is lost when redirection is intercepted #1679
Comments
@interDist sorry I never responded to this. Do you remember why this worked for you? I don't see |
I had to remember what this is about and my idea for a solution, this was one year ago... 😏 |
Understood. Unless we use that original response somewhere, I'm inclined to not collect it in the first place. If someone does need it, it's relatively straightforward to subclass |
Would it be possible then to add a callback point which subclasses can use? It would be called after the new response is created and before it is rendered, with both the original response and the redirect capture response. |
I think I'd be on board with a PR that changes From what I understand that should provide you with the hook to do what you need. |
The
RedirectsPanel
creates a new response, preserving only the cookies of the original response. Then any additional information in the original response is lost and cannot be made visible in the toolbar’s panels. In our case, each response has authorization information and I would like to be able to verify that this information is captured correctly also when the user is ultimately redirected. The fix looks quite straightforward, within theif
:https://github.com/jazzband/django-debug-toolbar/blob/f1387801e84a343fbce5c7955423f87589790a26/debug_toolbar/panels/redirects.py#L20
modify the code creating the new response to
Everything else will be taken care of by custom code in the relevant panels...
The text was updated successfully, but these errors were encountered: