File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Change Log
2
2
3
+ ## Unreleased
4
+
5
+ ### Fixed
6
+
7
+ - #41 : Response builder broke header value
8
+
9
+
3
10
## 1.2.0 - 2016-03-29
4
11
5
12
### Added
Original file line number Diff line number Diff line change @@ -23,13 +23,16 @@ function it_reads_headers_from_array(ResponseInterface $response)
23
23
$ this ->setHeadersFromArray (['HTTP/1.1 200 OK ' , 'Content-type: text/html ' ]);
24
24
}
25
25
26
- function it_reads_headers_from_string (ResponseInterface $ response )
26
+ /**
27
+ * @link https://github.com/php-http/message/issues/41
28
+ */
29
+ function it_splits_headers_correctly (ResponseInterface $ response )
27
30
{
28
31
$ response ->withStatus (200 , 'OK ' )->willReturn ($ response );
29
32
$ response ->withProtocolVersion ('1.1 ' )->willReturn ($ response );
30
33
$ response ->hasHeader ('Content-type ' )->willReturn (false );
31
- $ response ->withHeader ('Content-type ' , 'text/html ' )->willReturn ($ response );
34
+ $ response ->withHeader ('Content-type ' , 'application/xml+atom ' )->willReturn ($ response );
32
35
$ this ->beConstructedWith ($ response );
33
- $ this ->setHeadersFromString ("HTTP/1.1 200 OK \r\nContent-type: text/html \r\n" );
36
+ $ this ->setHeadersFromString ("HTTP/1.1 200 OK \r\nContent-type: application/xml+atom \r\n" );
34
37
}
35
38
}
Original file line number Diff line number Diff line change @@ -135,8 +135,8 @@ public function addHeader($headerLine)
135
135
sprintf ('"%s" is not a valid HTTP header line ' , $ headerLine )
136
136
);
137
137
}
138
- $ name = trim (urldecode ( $ parts [0 ]) );
139
- $ value = trim (urldecode ( $ parts [1 ]) );
138
+ $ name = trim ($ parts [0 ]);
139
+ $ value = trim ($ parts [1 ]);
140
140
if ($ this ->response ->hasHeader ($ name )) {
141
141
$ this ->response = $ this ->response ->withAddedHeader ($ name , $ value );
142
142
} else {
You can’t perform that action at this time.
0 commit comments