From 6478049ba8558160e76419fc8c0f6b1cd15a620d Mon Sep 17 00:00:00 2001 From: Chris Nanney Date: Thu, 2 Sep 2021 09:02:46 -0500 Subject: [PATCH] Remove mapWithKeys from Http Request and Response `headers()` methods (#38643) --- src/Illuminate/Http/Client/Request.php | 4 +--- src/Illuminate/Http/Client/Response.php | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Illuminate/Http/Client/Request.php b/src/Illuminate/Http/Client/Request.php index f8699b5ac4aa..0e493f1fa968 100644 --- a/src/Illuminate/Http/Client/Request.php +++ b/src/Illuminate/Http/Client/Request.php @@ -120,9 +120,7 @@ public function header($key) */ public function headers() { - return collect($this->request->getHeaders())->mapWithKeys(function ($values, $header) { - return [$header => $values]; - })->all(); + return $this->request->getHeaders(); } /** diff --git a/src/Illuminate/Http/Client/Response.php b/src/Illuminate/Http/Client/Response.php index dc25cb830acc..70672f3ea7f4 100644 --- a/src/Illuminate/Http/Client/Response.php +++ b/src/Illuminate/Http/Client/Response.php @@ -107,9 +107,7 @@ public function header(string $header) */ public function headers() { - return collect($this->response->getHeaders())->mapWithKeys(function ($v, $k) { - return [$k => $v]; - })->all(); + return $this->response->getHeaders(); } /**