Skip to content

Commit 17794b4

Browse files
authored
Apply suggestions from code review
1 parent 9d9974b commit 17794b4

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Diff for: CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Change Log
22

3-
## 1.3.2 - 2024-08-10
3+
## 1.4.0 - 2024-09-01
44

5-
- Remove default `Content-Length` header from MultipartStreamBuilder class.
5+
- No longer automatically add a `Content-Length` header for each part in MultipartStreamBuilder class to comply with RFC 7578 section 4.8.
66

77
## 1.3.1 - 2024-06-10
88

Diff for: src/MultipartStreamBuilder.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ public function addData($resource, array $headers = [])
9595
* @param string|resource|StreamInterface $resource
9696
* @param array $options {
9797
*
98-
* @var array $headers additional headers ['header-name' => 'header-value']
99-
* @var string $filename
100-
* }
98+
* @var array $headers additional headers ['header-name' => 'header-value']
99+
* @var string $filename
100+
* }
101101
*
102102
* @return MultipartStreamBuilder
103103
*/

Diff for: tests/FunctionTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,16 @@ public function testHeaders()
8888
$this->assertTrue(false === strpos($multipartStream, 'Content-Disposition:'));
8989
}
9090

91+
/**
92+
* Comply with RFC 7578 section 4.8
93+
*/
9194
public function testShouldNotContainContentLength()
9295
{
9396
$builder = new MultipartStreamBuilder();
9497
$builder->addResource('foobar', 'stream contents');
9598

9699
$multipartStream = (string) $builder->build();
97-
$this->assertTrue(false === strpos($multipartStream, 'Content-Length: 15'));
100+
$this->assertTrue(false === strpos($multipartStream, 'Content-Length:'));
98101
}
99102

100103
public function testFormName()

0 commit comments

Comments
 (0)