Skip to content

Commit 6663e5a

Browse files
Merge branch '4.3' into 4.4
* 4.3: Fix tests [Console] Fix commands description with numeric namespaces [HttpFoundation] Fixed typo [EventDispatcher] Better error reporting when arguments to dispatch() are swapped [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 [VarDumper] notice on potential undefined index [HttpClient] turn exception into log when the request has no content-type [Process] add tests for php executable finder if file does not exist [Cache] Make sure we get the correct number of values from redis::mget() [TwigBridge] Add row_attr to all form themes [Serializer] Fix MetadataAwareNameConverter usage with string group
2 parents 5da54cc + 955c977 commit 6663e5a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
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);

0 commit comments

Comments
 (0)