Skip to content

Commit d141fbe

Browse files
Merge branch '4.4' into 5.0
* 4.4: (28 commits) bug #34554 [HttpClient] Fix early cleanup of pushed HTTP/2 responses (lyrixx) Fix tests [Console] Fix commands description with numeric namespaces [HttpFoundation] Fixed typo [DI] Skip unknown method calls for factories in check types pass [EventDispatcher] Better error reporting when arguments to dispatch() are swapped improve upgrade instructions for twig.exception_controller configuration [HttpFoundation] Update CHANGELOG for PdoSessionHandler BC BREAK in 4.4 [Serializer] CsvEncoder::NO_HEADERS_KEY ignored when used in constructor [Form] Keep preferred_choices order for choice groups [Debug] work around failing chdir() on Darwin [PhpUnitBridge] Read configuration CLI directive [DI] Missing test on YamlFileLoader Revert "minor #34608 [Process] add tests for php executable finder if file does not exist (ahmedash95)" Simpler example for Apache basic auth workaround [Console] Fix trying to access array offset on value of type int [Config] Remove extra sprintf arg [HttpKernel] fix typo [HttpKernel] Support typehint to deprecated FlattenException in controller Add preview mode support for Html and Serializer error renderers ...
2 parents e886d61 + 9ac8f73 commit d141fbe

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Response/NativeResponse.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,18 @@ public function __destruct()
113113

114114
private function open(): void
115115
{
116-
set_error_handler(function ($type, $msg) { throw new TransportException($msg); });
116+
$url = $this->url;
117+
118+
set_error_handler(function ($type, $msg) use (&$url) {
119+
if (E_NOTICE !== $type || 'fopen(): Content-type not specified assuming application/x-www-form-urlencoded' !== $msg) {
120+
throw new TransportException($msg);
121+
}
122+
123+
$this->logger && $this->logger->info(sprintf('%s for "%s".', $msg, $url ?? $this->url));
124+
});
117125

118126
try {
119127
$this->info['start_time'] = microtime(true);
120-
$url = $this->url;
121128

122129
while (true) {
123130
$context = stream_context_get_options($this->context);

Tests/CurlHttpClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private function getVulcainClient(): CurlHttpClient
128128
return $client;
129129
}
130130

131-
if (200 !== $client->request('GET', 'http://127.0.0.1:8057/json')->getStatusCode()) {
131+
if (['application/json'] !== $client->request('GET', 'http://127.0.0.1:8057/json')->getHeaders()['content-type']) {
132132
$this->markTestSkipped('symfony/http-client-contracts >= 2.0.1 required');
133133
}
134134

0 commit comments

Comments
 (0)