Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 1.0.1 - 2016-01-29

### Changed

- Set the correct header for the Content-Length when in chunked mode.

## 1.0.0 - 2016-01-28

Expand Down
1 change: 1 addition & 0 deletions spec/ContentLengthPluginSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function it_streams_chunked_if_no_size(RequestInterface $request, StreamInterfac

$stream->getSize()->shouldBeCalled()->willReturn(null);
$request->withBody(Argument::type('Http\Message\Encoding\ChunkStream'))->shouldBeCalled()->willReturn($request);
$request->withAddedHeader('Transfer-Encoding', 'chunked')->shouldBeCalled()->willReturn($request);

$this->handleRequest($request, function () {}, function () {});
}
Expand Down
1 change: 1 addition & 0 deletions src/ContentLengthPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
if (null === $stream->getSize()) {
$stream = new ChunkStream($stream);
$request = $request->withBody($stream);
$request = $request->withAddedHeader('Transfer-Encoding', 'chunked');
} else {
$request = $request->withHeader('Content-Length', $stream->getSize());
}
Expand Down