Skip to content

Commit 4812a06

Browse files
[HttpClient][Contracts] rename "raw_headers" to "response_headers"
1 parent 5c0b558 commit 4812a06

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ResponseInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function toArray(bool $throw = true): array;
7979
* another, as the request/response progresses.
8080
*
8181
* The following info MUST be returned:
82-
* - raw_headers - an array modelled after the special $http_response_header variable
82+
* - response_headers - an array modelled after the special $http_response_header variable
8383
* - redirect_count - the number of redirects followed while executing the request
8484
* - redirect_url - the resolved location of redirect responses, null otherwise
8585
* - start_time - the time when the request was sent or 0.0 when it's pending

Test/HttpClientTestCase.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ public function testGetRequest()
4141
'user_data' => $data = new \stdClass(),
4242
]);
4343

44-
$this->assertSame([], $response->getInfo('raw_headers'));
44+
$this->assertSame([], $response->getInfo('response_headers'));
4545
$this->assertSame($data, $response->getInfo()['user_data']);
4646
$this->assertSame(200, $response->getStatusCode());
4747

4848
$info = $response->getInfo();
4949
$this->assertNull($info['error']);
5050
$this->assertSame(0, $info['redirect_count']);
51-
$this->assertSame('HTTP/1.1 200 OK', $info['raw_headers'][0]);
52-
$this->assertSame('Host: localhost:8057', $info['raw_headers'][1]);
51+
$this->assertSame('HTTP/1.1 200 OK', $info['response_headers'][0]);
52+
$this->assertSame('Host: localhost:8057', $info['response_headers'][1]);
5353
$this->assertSame('http://localhost:8057/', $info['url']);
5454

5555
$headers = $response->getHeaders();
@@ -105,7 +105,7 @@ public function testHttpVersion()
105105
]);
106106

107107
$this->assertSame(200, $response->getStatusCode());
108-
$this->assertSame('HTTP/1.0 200 OK', $response->getInfo('raw_headers')[0]);
108+
$this->assertSame('HTTP/1.0 200 OK', $response->getInfo('response_headers')[0]);
109109

110110
$body = $response->toArray();
111111

@@ -252,7 +252,7 @@ public function testRedirects()
252252
'Content-Type: application/json',
253253
];
254254

255-
$filteredHeaders = array_values(array_filter($response->getInfo('raw_headers'), function ($h) {
255+
$filteredHeaders = array_values(array_filter($response->getInfo('response_headers'), function ($h) {
256256
return \in_array(substr($h, 0, 4), ['HTTP', 'Loca', 'Cont'], true) && 'Content-Encoding: gzip' !== $h;
257257
}));
258258

@@ -326,7 +326,7 @@ public function testMaxRedirects()
326326
'Content-Type: application/json',
327327
];
328328

329-
$filteredHeaders = array_values(array_filter($response->getInfo('raw_headers'), function ($h) {
329+
$filteredHeaders = array_values(array_filter($response->getInfo('response_headers'), function ($h) {
330330
return \in_array(substr($h, 0, 4), ['HTTP', 'Loca', 'Cont'], true);
331331
}));
332332

0 commit comments

Comments
 (0)