Skip to content

Commit

Permalink
Merge pull request #432 from wallace/master
Browse files Browse the repository at this point in the history
Updates README.md to clarify writing middleware
  • Loading branch information
mislav committed Nov 4, 2014
2 parents ac7cc3a + 71973e5 commit 458f319
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -107,11 +107,13 @@ Middleware are classes that implement a `call` instance method. They hook into
the request/response cycle.

```ruby
def call(env)
def call(request_env)
# do something with the request
# request_env[:request_headers].merge!(...)

@app.call(env).on_complete do
@app.call(request_env).on_complete do |response_env|
# do something with the response
# response_env[:response_headers].merge!(...)
end
end
```
Expand Down

0 comments on commit 458f319

Please sign in to comment.