Browse Source

include raw http header string in the response as well

pull/2/head 0.1.6
Aaron Parecki 6 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": {
"indieweb/link-rel-parser": "0.1.*",
"mf2/mf2": "0.3.*"
"mf2/mf2": ">=0.3.2"
},
"autoload": {
"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
$response['headers'] = self::_parse_headers($response['header']);
$response['rels'] = \IndieWeb\http_rels($response['header']);
unset($response['header']);
return $response;
}

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

@ -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,

Loading…
Cancel
Save