From 88086b1ec933245b40d1b844bf5b57d41a80f35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Fabr=C3=A9gat?= Date: Thu, 3 May 2018 13:14:53 +0200 Subject: [PATCH 1/2] v1.3.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1eb994b..ddccaaf 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "codeinc/psr7-responses", - "version": "1.3.0", + "version": "1.3.1", "description": "A collection of PSR-7 responses", "homepage": "https://github.com/CodeIncHQ/Psr7Responses", "type": "library", From 2d638efd1fb3423bf1144443f9ae7f2a1342328f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Fabr=C3=A9gat?= Date: Thu, 3 May 2018 13:15:07 +0200 Subject: [PATCH 2/2] Content-Disposition header is now imported by HttpProxyResponse --- src/HttpProxyResponse.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/HttpProxyResponse.php b/src/HttpProxyResponse.php index 09f35cd..8cd540b 100644 --- a/src/HttpProxyResponse.php +++ b/src/HttpProxyResponse.php @@ -35,6 +35,14 @@ */ class HttpProxyResponse extends Response { + protected const IMPORT_HEADERS = [ + 'content-type', + 'last-modified', + 'content-length', + 'date', + 'content-disposition' + ]; + /** * ProxyResponse constructor. * @@ -68,7 +76,7 @@ public function __construct(string $remoteUrl, int $status = 200, array $headers // importing the headers foreach ($http_response_header as $header) { if (preg_match('/^([\\w-]+): +(.+)$/ui', $header, $matches)) { - if (in_array(strtolower($matches[1]), ['content-type', 'last-modified', 'content-length', 'date'])) { + if (in_array(strtolower($matches[1]), self::IMPORT_HEADERS)) { $headers[$matches[1]] = $matches[2]; } }