Skip to content

Commit 5909b16

Browse files
committed
Keep body size limit for AMP redirects
1 parent 05316df commit 5909b16

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/Symfony/Component/HttpClient/Response/AmpResponseV4.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ private static function followRedirects(Request $originRequest, AmpClientStateV4
331331
$request->setTcpConnectTimeout($originRequest->getTcpConnectTimeout());
332332
$request->setTlsHandshakeTimeout($originRequest->getTlsHandshakeTimeout());
333333
$request->setTransferTimeout($originRequest->getTransferTimeout());
334+
$request->setBodySizeLimit($originRequest->getBodySizeLimit());
334335

335336
if (303 === $status || \in_array($status, [301, 302], true) && 'POST' === $response->getRequest()->getMethod()) {
336337
// Do like curl and browsers: turn POST to GET on 301, 302 and 303

src/Symfony/Component/HttpClient/Response/AmpResponseV5.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ private static function followRedirects(Request $originRequest, AmpClientStateV5
327327
$request->setTcpConnectTimeout($originRequest->getTcpConnectTimeout());
328328
$request->setTlsHandshakeTimeout($originRequest->getTlsHandshakeTimeout());
329329
$request->setTransferTimeout($originRequest->getTransferTimeout());
330+
$request->setBodySizeLimit($originRequest->getBodySizeLimit());
330331

331332
if (\in_array($status, [301, 302, 303], true)) {
332333
$originRequest->removeHeader('transfer-encoding');

0 commit comments

Comments
 (0)