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 Stack #1112

Closed
wants to merge 3 commits into from
Closed

Conversation

HoneyryderChuck
Copy link

This proposes a basic spec for the middleware chain/stack, which is built within the Rack::Builder class (ivar @use).

A class implementing the middleware stack should implement both #useand #to_app,where:

  • #use receives a middleware class, arguments and block;
  • #to_app receives a rack app and returns the app chained with the middlewares.

This is an attempt to support #1111 , which proposes to replace the main rack builder app middleware stack with the rails application middleware object, removing the need to support 2 different middleware stacks.

Tiago Cardoso added 3 commits September 13, 2016 16:37
…mizes the API one has to support and expect for them; also added the possibility of passing an existing stack as the parameter of #use
@jeremyevans
Copy link
Contributor

I think middleware stacks are something best handled by frameworks using rack as opposed to rack itself. I don't think think we want to add this feature to rack.

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 this pull request may close these issues.

2 participants