You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some laravel code that is making an HTTP request like so:
Http::get(...)->getBody()->getContents();
With clockwork enabled, this starts returning empty string (took a long time to track down the root cause). I tracked this down to LaravelHttpClientDataSource, which by default consumes the request body.
I feel like clockwork should strive to have no observable side-effects. In this case, I think the solution could be some additional logic to reset the stream. Something like this:
$body = $response->getBody();
if (!$body->isSeekable()) { return null; } // not safe to collect
$position = $body->tell();
// obviously need to integrate the enabled checks for these
$rawContent = $body->toString();
$json = $response->json();
$body->seek($position); // restore the original position
The text was updated successfully, but these errors were encountered:
I have some laravel code that is making an HTTP request like so:
With clockwork enabled, this starts returning empty string (took a long time to track down the root cause). I tracked this down to
LaravelHttpClientDataSource
, which by default consumes the request body.I feel like clockwork should strive to have no observable side-effects. In this case, I think the solution could be some additional logic to reset the stream. Something like this:
The text was updated successfully, but these errors were encountered: