Skip to content

Commit

Permalink
Prevent Memory Leak when using hideRequestParameters and hideRequestH…
Browse files Browse the repository at this point in the history
…eaders (#1350)

* Prevent Memory Leak when using hideRequestHeaders

* Prevent Memory Leak when using hideRequestParameters

* Update Telescope.php

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
danilopinotti and taylorotwell authored May 29, 2023
1 parent 9bbfc8f commit 12cf59c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Telescope.php
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,10 @@ protected static function collectUpdates($batchId)
*/
public static function hideRequestHeaders(array $headers)
{
static::$hiddenRequestHeaders = array_merge(
static::$hiddenRequestHeaders = array_values(array_unique(array_merge(
static::$hiddenRequestHeaders,
$headers
);
)));

return new static;
}
Expand Down Expand Up @@ -758,10 +758,10 @@ public static function hideRequestParameters(array $attributes)
*/
public static function hideResponseParameters(array $attributes)
{
static::$hiddenResponseParameters = array_merge(
static::$hiddenResponseParameters = array_values(array_unique(array_merge(
static::$hiddenResponseParameters,
$attributes
);
)));

return new static;
}
Expand Down

0 comments on commit 12cf59c

Please sign in to comment.