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

application middleware: body == [] #1012

Closed
glaszig opened this issue Aug 15, 2019 · 1 comment
Closed

application middleware: body == [] #1012

glaszig opened this issue Aug 15, 2019 · 1 comment
Assignees
Labels

Comments

@glaszig
Copy link

glaszig commented Aug 15, 2019

i want to use a rack middleware application-level to inject things into the response.

# apps/web/application.rb
      middleware.use(Class.new do
        def initialize app
          @app = app
        end

        def call env
          status, headers, body = @app.call env
          byebug
          [ status, headers, body ]
        end
      end)

but body is empty ([]). why is that? what am i doing wrong?

it works on project-level, btw.

@jodosha
Copy link
Member

jodosha commented Sep 16, 2019

@glaszig I can't reproduce the bug. I just tried locally with your code and it works. Can you please create a dummy app to reproduce it? Thanks.

@jodosha jodosha closed this as completed Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants