From 8e8d0edc74a13fe592ca5b1c392b41c63f519ecc Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 15 Jun 2020 07:28:47 +0000 Subject: [PATCH] Remove headers with internal meaning from HttpClient responses --- HttpClientKernel.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HttpClientKernel.php b/HttpClientKernel.php index 912ce313f8..2056a673a6 100644 --- a/HttpClientKernel.php +++ b/HttpClientKernel.php @@ -58,6 +58,10 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ $response = new Response($response->getContent(!$catch), $response->getStatusCode(), $response->getHeaders(!$catch)); + $response->headers->remove('X-Body-File'); + $response->headers->remove('X-Body-Eval'); + $response->headers->remove('X-Content-Digest'); + $response->headers = new class($response->headers->all()) extends ResponseHeaderBag { protected function computeCacheControlValue(): string {