Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit efc93cd

Browse filesBrowse files
[HttpClient][Mailer] Revert "Let curl handle transfer encoding", use HTTP/1.1 for Mailgun
1 parent e79eea1 commit efc93cd
Copy full SHA for efc93cd

File tree

2 files changed

+4
-2
lines changed
Filter options

2 files changed

+4
-2
lines changed

‎src/Symfony/Component/HttpClient/CurlHttpClient.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/CurlHttpClient.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,9 @@ public function request(string $method, string $url, array $options = []): Respo
246246

247247
if (isset($options['normalized_headers']['content-length'][0])) {
248248
$curlopts[\CURLOPT_INFILESIZE] = (int) substr($options['normalized_headers']['content-length'][0], \strlen('Content-Length: '));
249-
} elseif (!isset($options['normalized_headers']['transfer-encoding'])) {
250-
$curlopts[\CURLOPT_INFILESIZE] = -1;
249+
}
250+
if (!isset($options['normalized_headers']['transfer-encoding'])) {
251+
$curlopts[\CURLOPT_HTTPHEADER][] = 'Transfer-Encoding:'.(isset($curlopts[\CURLOPT_INFILESIZE]) ? '' : ' chunked');
251252
}
252253

253254
if ('POST' !== $method) {

‎src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunHttpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunHttpTransport.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ protected function doSendHttp(SentMessage $message): ResponseInterface
6363

6464
$endpoint = sprintf('%s/v3/%s/messages.mime', $this->getEndpoint(), urlencode($this->domain));
6565
$response = $this->client->request('POST', 'https://'.$endpoint, [
66+
'http_version' => '1.1',
6667
'auth_basic' => 'api:'.$this->key,
6768
'headers' => $headers,
6869
'body' => $body->bodyToIterable(),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.