-
Notifications
You must be signed in to change notification settings - Fork 4
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
Rewind body resource after logged it. #8
Conversation
Thank you for contributing. I'll have a look tomorrow. |
@cjost1988 This would also solve #2 @nuvolapl Thanks for your contribution. We'll look into this PR today. |
@cjost1988 @tzfrs I don't know why i push both commit in one PR. Feel free to split it. I didn't write tests because of... laziness :) |
@nuvolapl Sorry for the late reply. I'll be closing this issue for multiple reasons.
However, the issues you solved with this PR where issues we had on our todo list and since we now know that this is a wanted feature we would develop it soon. I hope I can finish this feature request this week, otherwise I'd finish this on the weekend. |
Having found this pull request and being annoyed that logging does not rewind the response, I looked up guzzle's github page to find the best way to read the contents.
Adding this comment in case it helps anyone else that finds it. |
Hi @wizbit We're open to change how the rewinding process works (end of middleware instead of start) but we have a hard time seeing which benefits it would give us. As said before, the downside to rewinding the body is that it will be done in every middleware even if a) There is no further middleware That's why we think it's the best to rewind the body only on your middleware if you need it. But, like I said, we're open to hear WHY you think the other approach would be better. We're def. open for that! 👍 |
@wizbit Thank you for participating in discussion. We discussed rewinding the response stream after logging and didn't found any reason to do so. We don't rewind since it might be a performance issue rewinding every response even if the response is not used anymore after the middleware used it. Imagine requests that do not have a response that matter like If we would change the responsibility for resetting the response pointer every client/middleware has to ensure that the pointer is reseted at the end of it's runtime what would also mean that any last middleware or client would rewind the response for nothing. It would be interesting why you want that the client/middleware has to rewind the response after reading instead before, please let us know. |
No description provided.