pull/664/head
KnifeLemon 2 weeks ago
commit 5ccc8fba98

@ -639,8 +639,7 @@ class Request
$data[$keyName] = [$data[$keyName]];
}
$data[$keyName][] = $value;
}
else {
} else {
$data[$keyName] = $value;
}
continue;
@ -667,8 +666,7 @@ class Request
if ($bytes === false) {
$tmpFile['error'] = UPLOAD_ERR_CANT_WRITE;
}
else {
} else {
// delete the temporary file before ended script
register_shutdown_function(function () use ($tmpName): void {
if (file_exists($tmpName)) {

@ -63,32 +63,8 @@ class RequestBodyParserTest extends TestCase
private function assertUrlEncodedParsing(string $method): void
{
$body = 'foo=bar&baz=qux&key=value';
$tmpfile = tmpfile();
$stream_path = stream_get_meta_data($tmpfile)['uri'];
file_put_contents($stream_path, $body);
$config = [
'url' => '/',
'base' => '/',
'method' => $method,
'referrer' => '',
'ip' => '127.0.0.1',
'ajax' => false,
'scheme' => 'http',
'user_agent' => 'Test',
'type' => 'application/x-www-form-urlencoded',
'length' => strlen($body),
'secure' => false,
'accept' => '',
'proxy_ip' => '',
'host' => 'localhost',
'servername' => 'localhost',
'stream_path' => $stream_path,
'data' => new Collection(),
'query' => new Collection(),
'cookies' => new Collection(),
'files' => new Collection()
];
$tmpfile = null;
$config = $this->createRequestConfig($method, 'application/x-www-form-urlencoded', $body, $tmpfile);
$request = new Request($config);

Loading…
Cancel
Save