Skip to content

Commit

Permalink
Merge pull request #22 from gdubost/fix/37826
Browse files Browse the repository at this point in the history
[FIX#37826] Filtre proxy des headers de la v1
  • Loading branch information
TinyTinyKame authored Nov 3, 2016
2 parents 53b437a + afafa5f commit c83b2d6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/DumbMethodsProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ public static function requestWithJsonResponse(GuzzleRequest $request, Applicati
$response = $request
->addCookie("authenticator", $cookie)
->send();
$headers = $response->getHeaders()->toArray();

$headers = array_filter(
$response->getHeaders()->toArray(),
function ($value, $name) {
return 0 === preg_match("/^.*-encoding|connection(?:-.*)*?/i", $name);
},
ARRAY_FILTER_USE_BOTH
);

return $app->json(json_decode($response->getBody()), 200, $headers);
} catch (\Guzzle\Http\Exception\BadResponseException $client_error) {
return $app->abort(
Expand Down

0 comments on commit c83b2d6

Please sign in to comment.