falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.5k stars 935 forks source link

Milddleware process_resource() requires four arguments #751

Closed warsaw closed 8 years ago

warsaw commented 8 years ago

Undocumented by http://falcon.readthedocs.org/en/latest/api/middleware.html a middleware component's process_resource() method requires a fourth argument which is the params.

dergigi commented 8 years ago

I think I ran into this issue as well. I tried to get the more complex example working and encountered the following error on any request:

2016-04-16 18:23:44 +0200] [13566] [ERROR] Error handling request /
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/gunicorn/workers/sync.py", line 130, in handle
    self.handle_request(listener, req, client, addr)
  File "/Library/Python/2.7/site-packages/gunicorn/workers/sync.py", line 171, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/Library/Python/2.7/site-packages/falcon/api.py", line 167, in __call__
    self._call_req_mw(middleware_stack, req, resp)
  File "/Library/Python/2.7/site-packages/falcon/api.py", line 535, in _call_req_mw
    process_request(req, resp)
  File "/Users/gigi/Development/newspaper3k-api-using-falcon/more-complex-example.py", line 61, in process_request
    href='http://docs.example.com/auth')
TypeError: __init__() takes exactly 4 arguments (3 given)

Any hints on how I might resolve this?

kgriffs commented 8 years ago

@warsaw Looks like this slipped through the cracks. It was mentioned in the changelog, but the docs didn't get updated to reflect the new param. I'll fix this up pronto. Thanks!

kgriffs commented 8 years ago

@Gigi33 This looks to be a separate problem with HTTPUnauthorized. Would you mind creating a new issue for this? Might be a breaking change that was not documented, but I'll have to dig into it further to be sure.