From 171fe2e71a83b1155cdfc93cdc3156ad97165712 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 22 Jan 2018 15:06:21 -0500 Subject: [PATCH] include raw http header string in the response as well --- composer.json | 2 +- src/p3k/HTTP.php | 1 - src/p3k/HTTP/Test.php | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b471b50..48f421c 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "indieweb/link-rel-parser": "0.1.*", - "mf2/mf2": "0.3.*" + "mf2/mf2": ">=0.3.2" }, "autoload": { "psr-4": { diff --git a/src/p3k/HTTP.php b/src/p3k/HTTP.php index 26443d4..7ae2d35 100644 --- a/src/p3k/HTTP.php +++ b/src/p3k/HTTP.php @@ -73,7 +73,6 @@ class HTTP { // Parses the HTTP headers and adds the "headers" and "rels" response keys $response['headers'] = self::_parse_headers($response['header']); $response['rels'] = \IndieWeb\http_rels($response['header']); - unset($response['header']); return $response; } diff --git a/src/p3k/HTTP/Test.php b/src/p3k/HTTP/Test.php index 2b580d5..d0c42b8 100644 --- a/src/p3k/HTTP/Test.php +++ b/src/p3k/HTTP/Test.php @@ -45,6 +45,7 @@ class Test implements Transport { $response = $this->_read_file($url); return [ 'code' => (int)$response['code'], + 'header' => $response['header'], 'headers' => $response['headers'], 'rels' => $response['rels'], 'error' => '', @@ -88,6 +89,7 @@ class Test implements Transport { } else { return [ 'code' => 0, + 'header' => $headers, 'headers' => $parsedHeaders, 'rels' => \IndieWeb\http_rels($headers), 'body' => $body, @@ -102,6 +104,7 @@ class Test implements Transport { return [ 'code' => (int)$code, + 'header' => $headers, 'headers' => $parsedHeaders, 'rels' => \IndieWeb\http_rels($headers), 'body' => $body,