diff options
| author | Michael Merickel <michael@merickel.org> | 2014-11-04 20:10:33 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2014-11-04 20:12:54 -0600 |
| commit | e4e8c478c61b6d032a07c1153d12c12c15a711e9 (patch) | |
| tree | b8a9faf4ddc4ba0a14a9bf85502a7956a18ebef6 | |
| parent | ec67aba9d62d0e32dc5154c940a2214441bf0a9e (diff) | |
| download | webob-fix.wsgify-middleware-docs.tar.gz | |
bring docs up-to-date with actual wsgify signaturefix.wsgify-middleware-docs
the tests and code clearly expect (req, app, **kw) and it makes sense that it
would be that way since req is the ephemeral argument and the rest are
defined at setup-time. The documented order before was (app, req, **kw)
which puts the req in-between multiple config arguments in the
signature.
fixes #25, #120
| -rw-r--r-- | webob/dec.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/webob/dec.py b/webob/dec.py index 8e21d40..dc79b66 100644 --- a/webob/dec.py +++ b/webob/dec.py @@ -222,7 +222,7 @@ class wsgify(object): Use this like:: @wsgify.middleware - def restrict_ip(app, req, ips): + def restrict_ip(req, app, ips): if req.remote_addr not in ips: raise webob.exc.HTTPForbidden('Bad IP: %s' % req.remote_addr) return app @@ -236,7 +236,7 @@ class wsgify(object): Or if you want to write output-rewriting middleware:: @wsgify.middleware - def all_caps(app, req): + def all_caps(req, app): resp = req.get_response(app) resp.body = resp.body.upper() return resp |
