Skip to content

Conversation

@michaelnabil230
Copy link
Contributor

This PR resolves an issue that occurs when making streamed HTTP requests using Http::withOptions(['stream' => true]) in Laravel.

🔗 Fixes:

✅ Changes

  • Prevents Telescope from interfering with streamed responses.
  • Ensures chunked HTTP responses are handled correctly and without buffering.

This improves the stability and reliability of stream-based operations in Laravel applications.


🧪 Testing Note

Currently, I haven’t included an automated test for this change, as it's not clear how to effectively test streamed HTTP responses in this case.
The fix has been manually verified and works as expected.

If anyone has experience or ideas on how to write a proper test for streamed requests, contributions are very welcome!

@michaelnabil230
Copy link
Contributor Author

The issue occurs when calling $response->body() on a streamed response — it fails to convert to a string, though I'm not entirely sure why. However, adding a condition to check if the response is streamed before accessing the body resolves the problem.

@taylorotwell taylorotwell merged commit 0b9e168 into laravel:5.x Aug 3, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants