swoft-cloud / swoft-component

📦 This is a repository of centralized management of all swoft core components
https://www.swoft.org
Apache License 2.0
96 stars 107 forks source link

修复验证器过滤后的GET参数使用$request->input()获取仍然是源数据问题 #610

Closed wvfeng closed 2 years ago

wvfeng commented 2 years ago
namespace Swoft\Http\Server\Middleware;
...

/**
 * Class ValidatorMiddleware
 *
 * @Bean()
 *
 * @since 2.0
 */
class ValidatorMiddleware implements MiddlewareInterface
{
    ...
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
       ...
        $request = $request->withParsedBody($parsedBody)->withParsedQuery($query)->withParsedPath($path);
        return $handler->handle($request);
    }
}

What does this PR do?

Does this fix any issues or need any specific reviewers?

Fixes: swoft-cloud/swoft# Reviewers: @

Motivation

More

Additional Notes