Skip to content

[HttpClient] do not lose response information when truncating the debug buffer #60295

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

Merged
merged 1 commit into from
May 2, 2025

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Apr 28, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

@carsonbot carsonbot added this to the 7.3 milestone Apr 28, 2025
@carsonbot carsonbot changed the title [HttpClient] do not lose response information when truncating the debug buffer [HttpClient] do not lose response information when truncating the debug buffer Apr 28, 2025
@@ -221,6 +220,7 @@ public function getInfo(?string $type = null): mixed
rewind($this->debugBuffer);
ftruncate($this->debugBuffer, 0);
}
$this->info = array_merge($this->info, $info);
Copy link
Member Author

Choose a reason for hiding this comment

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

Before #60241 getInfo() could have been called multiple times but the debug info would always be present as the debug buffer was never truncated and thus preserved for subsequent calls. This is no longer the case as we truncate the buffer two lines above just after reading it. Following calls of getInfo() would this no longer read the debug information from the buffer but we need to store it at some other place.

@fabpot
Copy link
Member

fabpot commented May 2, 2025

Thank you @xabbuh.

@fabpot fabpot merged commit e01f633 into symfony:7.3 May 2, 2025
11 checks passed
@xabbuh xabbuh deleted the pr-60241 branch May 2, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants