Browse Source

include raw http header string in the response as well

pull/2/head 0.1.6
Aaron Parecki 7 years ago
parent
commit
171fe2e71a
No known key found for this signature in database GPG Key ID: 276C2817346D6056
3 changed files with 4 additions and 2 deletions
  1. +1
    -1
      composer.json
  2. +0
    -1
      src/p3k/HTTP.php
  3. +3
    -0
      src/p3k/HTTP/Test.php

+ 1
- 1
composer.json View File

@ -12,7 +12,7 @@
], ],
"require": { "require": {
"indieweb/link-rel-parser": "0.1.*", "indieweb/link-rel-parser": "0.1.*",
"mf2/mf2": "0.3.*"
"mf2/mf2": ">=0.3.2"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

+ 0
- 1
src/p3k/HTTP.php View File

@ -73,7 +73,6 @@ class HTTP {
// Parses the HTTP headers and adds the "headers" and "rels" response keys // Parses the HTTP headers and adds the "headers" and "rels" response keys
$response['headers'] = self::_parse_headers($response['header']); $response['headers'] = self::_parse_headers($response['header']);
$response['rels'] = \IndieWeb\http_rels($response['header']); $response['rels'] = \IndieWeb\http_rels($response['header']);
unset($response['header']);
return $response; return $response;
} }

+ 3
- 0
src/p3k/HTTP/Test.php View File

@ -45,6 +45,7 @@ class Test implements Transport {
$response = $this->_read_file($url); $response = $this->_read_file($url);
return [ return [
'code' => (int)$response['code'], 'code' => (int)$response['code'],
'header' => $response['header'],
'headers' => $response['headers'], 'headers' => $response['headers'],
'rels' => $response['rels'], 'rels' => $response['rels'],
'error' => '', 'error' => '',
@ -88,6 +89,7 @@ class Test implements Transport {
} else { } else {
return [ return [
'code' => 0, 'code' => 0,
'header' => $headers,
'headers' => $parsedHeaders, 'headers' => $parsedHeaders,
'rels' => \IndieWeb\http_rels($headers), 'rels' => \IndieWeb\http_rels($headers),
'body' => $body, 'body' => $body,
@ -102,6 +104,7 @@ class Test implements Transport {
return [ return [
'code' => (int)$code, 'code' => (int)$code,
'header' => $headers,
'headers' => $parsedHeaders, 'headers' => $parsedHeaders,
'rels' => \IndieWeb\http_rels($headers), 'rels' => \IndieWeb\http_rels($headers),
'body' => $body, 'body' => $body,

Loading…
Cancel
Save