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

Adding middleware on $app->addRoute not gonna work #19

Closed
iqbalfn opened this issue Dec 15, 2020 · 1 comment · Fixed by #20
Closed

Adding middleware on $app->addRoute not gonna work #19

iqbalfn opened this issue Dec 15, 2020 · 1 comment · Fixed by #20

Comments

@iqbalfn
Copy link

iqbalfn commented Dec 15, 2020

As the title said, adding middlewares with $app->addRoute($method, $path, $handler, ['middleware'=>[...]]) not gonna work because the script that add the middleware overwritten.

Please inspect this line

public function addRoute($httpMethod, string $route, $handler, array $options = [])
{
    // ...
    return $router->addRoute($httpMethod, $route, $handler, $options = []);
}

It should return $router->addRoute($httpMethod, $route, $handler, $options);.

@Reasno
Copy link
Member

Reasno commented Dec 16, 2020

Thank you for reporting this bug. It will be fixed soon.

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

Successfully merging a pull request may close this issue.

2 participants