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
If you have a very large json content, line 183 in RequestWatcher will throw an "Allowed memory size of XXX bytes exhausted".
Could this be solved by checking the contentWithinLimits before trying to json_decode? Something along the lines of below code. Let me know if I should do a PR for this.
if (is_string($content)) {
// Check if content is JSON and within size limits
if ($this->contentWithinLimits($content) &&
is_array(json_decode($content, true)) &&
json_last_error() === JSON_ERROR_NONE) {
return $this->hideParameters(json_decode($content, true), Telescope::$hiddenResponseParameters);
}
// Check for plain text content type
$contentType = strtolower($response->headers->get('Content-Type') ?? '');
if (Str::startsWith($contentType, 'text/plain')) {
return $this->contentWithinLimits($content) ? $content : 'Purged By Telescope';
}
}
Steps To Reproduce
Make a very large json response in a request.
The text was updated successfully, but these errors were encountered:
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Telescope Version
5.2
Laravel Version
10.44
PHP Version
8.2
Database Driver & Version
No response
Description
If you have a very large json content, line 183 in RequestWatcher will throw an "Allowed memory size of XXX bytes exhausted".
Could this be solved by checking the contentWithinLimits before trying to json_decode? Something along the lines of below code. Let me know if I should do a PR for this.
Steps To Reproduce
Make a very large json response in a request.
The text was updated successfully, but these errors were encountered: