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: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fix stacktrace missing from payload for non-exception events (#1123)
- Fix capturing of the request body in the `RequestIntegration` integration when the stream is empty (#1119)

## 3.0.3 (2020-10-12)

Expand All @@ -11,11 +12,11 @@

## 3.0.2 (2020-10-02)

- fix: Use the traces sample rate for traces instead of the event sample rate (#1106)
- Fix use of the `sample_rate` option rather than `traces_sample_rate` when capturing a `Transaction` (#1106)

## 3.0.1 (2020-10-01)

- fix: Use Span on Scope instead of Transaction for GuzzleMiddleware (#1099)
- Fix use of `Transaction` instead of `Span` in the `GuzzleMiddleware` middleware (#1099)

## 3.0.0 (2020-09-28)

Expand Down
2 changes: 1 addition & 1 deletion src/Integration/RequestIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private function captureRequestBody(Options $options, ServerRequestInterface $re
$requestBodySize = $request->getBody()->getSize();

if (
null === $requestBodySize ||
!$requestBodySize ||
'none' === $maxRequestBodySize ||
('small' === $maxRequestBodySize && $requestBodySize > self::REQUEST_BODY_SMALL_MAX_CONTENT_LENGTH) ||
('medium' === $maxRequestBodySize && $requestBodySize > self::REQUEST_BODY_MEDIUM_MAX_CONTENT_LENGTH)
Expand Down
28 changes: 25 additions & 3 deletions tests/Integration/RequestIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ public function invokeDataProvider(): iterable
(new ServerRequest('POST', new Uri('http://www.example.com/foo')))
->withUploadedFiles([
'foo' => new UploadedFile('foo content', 123, UPLOAD_ERR_OK, 'foo.ext', 'application/text'),
]),
])
->withBody($this->getStreamMock(123 + 321)),
Comment thread
ste93cry marked this conversation as resolved.
[
'url' => 'http://www.example.com/foo',
'method' => 'POST',
Expand Down Expand Up @@ -333,7 +334,8 @@ public function invokeDataProvider(): iterable
new UploadedFile('foo content', 123, UPLOAD_ERR_OK, 'foo.ext', 'application/text'),
new UploadedFile('bar content', 321, UPLOAD_ERR_OK, 'bar.ext', 'application/octet-stream'),
],
]),
])
->withBody($this->getStreamMock(123 + 321)),
[
'url' => 'http://www.example.com/foo',
'method' => 'POST',
Expand Down Expand Up @@ -371,7 +373,8 @@ public function invokeDataProvider(): iterable
new UploadedFile('bar content', 321, UPLOAD_ERR_OK, 'bar.ext', 'application/octet-stream'),
],
],
]),
])
->withBody($this->getStreamMock(123 + 321)),
[
'url' => 'http://www.example.com/foo',
'method' => 'POST',
Expand Down Expand Up @@ -459,6 +462,25 @@ public function invokeDataProvider(): iterable
null,
null,
];

yield [
[
'max_request_body_size' => 'always',
],
(new ServerRequest('POST', new Uri('http://www.example.com/foo')))
->withHeader('Content-Type', 'application/json')
->withBody($this->getStreamMock(0)),
[
'url' => 'http://www.example.com/foo',
'method' => 'POST',
'headers' => [
'Host' => ['www.example.com'],
'Content-Type' => ['application/json'],
],
],
null,
null,
];
}

private function getStreamMock(?int $size, string $content = ''): StreamInterface
Expand Down