From f0df446e2003741b32b583676e1afdb7ef49b77d Mon Sep 17 00:00:00 2001 From: Andreas Lutro Date: Mon, 13 Jul 2015 09:03:30 +0200 Subject: [PATCH] headers are case-insensitive, correct docblock types --- src/Request.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Request.php b/src/Request.php index 18e0b05..a1db24b 100644 --- a/src/Request.php +++ b/src/Request.php @@ -190,6 +190,7 @@ public function formatHeaders() */ public function setHeader($key, $value) { + $key = strtolower($key); $this->headers[$key] = $value; return $this; @@ -204,6 +205,8 @@ public function setHeader($key, $value) */ public function getHeader($key) { + $key = strtolower($key); + return isset($this->headers[$key]) ? $this->headers[$key] : null; } @@ -281,7 +284,7 @@ public function getOption($key) * * @param string $user * - * @return mixed + * @return static */ public function setUser($user) { @@ -295,7 +298,7 @@ public function setUser($user) * * @param string $pass * - * @return mixed + * @return static */ public function setPass($pass) { @@ -376,6 +379,8 @@ public function setEncoding($encoding) /** * Get the current encoding which will be used on the POST data + * + * @return int a Request::ENCODING_* constant */ public function getEncoding() {