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

Support passing keyword arguments to middlewares #104

Closed
Juanmcuello opened this issue Apr 12, 2023 · 3 comments · Fixed by #105
Closed

Support passing keyword arguments to middlewares #104

Juanmcuello opened this issue Apr 12, 2023 · 3 comments · Fixed by #105

Comments

@Juanmcuello
Copy link
Contributor

It seems Cuba is not forwarding kargs to the app, so this is not working for me:

API.use MyMiddleware, foo, bar: 'baz'

I can create a PR to forward kargs if that makes sense. Something like this:

def self.use(middleware, *args, **karsg, &block)
  app.use(middleware, *args, **karsg, &block)
end
@Juanmcuello
Copy link
Contributor Author

@soveran , just to know if you had a chance to take a look at this. Thanks!

@soveran
Copy link
Owner

soveran commented Apr 26, 2023

@Juanmcuello Hey! Yes, please create a PR. Use kwargs as the name of that argument.

Thanks!

Juanmcuello pushed a commit to Juanmcuello/cuba that referenced this issue Apr 26, 2023
Juanmcuello pushed a commit to Juanmcuello/cuba that referenced this issue Apr 26, 2023
@Juanmcuello
Copy link
Contributor Author

Done!

soveran pushed a commit that referenced this issue Apr 27, 2023
Fix #104

Co-authored-by: Juan Manuel Cuello <jcuello@fu.do>
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