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

GuzzleClient - change body retrieval to rewind stream #552

Merged
merged 2 commits into from Aug 27, 2019
Merged

GuzzleClient - change body retrieval to rewind stream #552

merged 2 commits into from Aug 27, 2019

Conversation

DavidGoodwin
Copy link
Contributor

Logging (or other) middleware may have already read from the Guzzle body - getContents() only returns remaining contents from the stream.

We definitely want it all, so cast to a string (which forces a rewind)

See also: https://stackoverflow.com/a/30549372/86696

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • [ x ] I acknowledge that all my contributions will be made under the project's license.

Logging (or other) middleware may have already read from the Guzzle body - getContents() only returns remaining contents from the stream, we definitely want it all here, so cast to a string (which forces a rewind) - see also: https://stackoverflow.com/a/30549372/86696
@DavidGoodwin DavidGoodwin changed the title GuzzleClient - fix body retrieval to rewind GuzzleClient - change body retrieval to rewind stream Jul 23, 2019
Twilio/Http/GuzzleClient.php Outdated Show resolved Hide resolved
Twilio/Http/GuzzleClient.php Outdated Show resolved Hide resolved
@childish-sambino childish-sambino added status: code review request requesting a community code review or review from Twilio status: waiting for feedback waiting for feedback from the submitter type: community enhancement feature request not on Twilio's roadmap labels Aug 26, 2019
@DavidGoodwin
Copy link
Contributor Author

PR updated a little ... thanks :)

Copy link
Contributor

@childish-sambino childish-sambino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks! LGTM

@childish-sambino childish-sambino added status: ready for deploy code ready to be released in next deploy and removed status: waiting for feedback waiting for feedback from the submitter labels Aug 27, 2019
@childish-sambino childish-sambino merged commit b26fa96 into twilio:master Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio status: ready for deploy code ready to be released in next deploy type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants