Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

middleware中执行参数解析导致s参数进入 #1136

Open
LonelySally opened this issue Jul 24, 2023 · 1 comment
Open

middleware中执行参数解析导致s参数进入 #1136

LonelySally opened this issue Jul 24, 2023 · 1 comment

Comments

@LonelySally
Copy link

在middleware中执行$request->param()后,后续在controller中执行dump($request->param())会导致"s" => "/ab/123"进入入参数组.


//middleware伪代码
    public function handle(Request $request, Closure $next): mixed
    {
   $request->param();
   }

//controller伪代码
    public function index(Request $request)
    {
        dump($request->param());//输出array中会多出s参数
    }

@LonelySally
Copy link
Author

LonelySally commented Jul 26, 2023

在将中间件定义到config/router.php(路由中间件)中解析执行正常,以上情况仅在middleware.php(全局中间件)中定义会发生.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant