Skip to content

Instantly share code, notes, and snippets.

@vortec
Created March 14, 2016 14:08
Show Gist options
  • Save vortec/d8adca10a75fabd13a0e to your computer and use it in GitHub Desktop.
Save vortec/d8adca10a75fabd13a0e to your computer and use it in GitHub Desktop.
@hug.authentication.authenticator
def header_exists(request, response, verify_user, **kwargs):
print("yo")
return {'user': 'foo'}
@hug.get('/test', requires=header_exists)
def test(user: hug.directives.user):
return "hai"
Traceback (most recent call last):
File "/Users/fkochem/.pyenv/versions/3.5.0/lib/python3.5/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/Users/fkochem/workspace/instances/python3/lib/python3.5/site-packages/falcon/api.py", line 182, in __call__
responder(req, resp, **params)
File "/Users/fkochem/workspace/code/hug/hug/interface.py", line 538, in __call__
lacks_requirement = self.check_requirements(request, response)
File "/Users/fkochem/workspace/code/hug/hug/interface.py", line 173, in check_requirements
conclusion = requirement(response=response, request=request, module=self.api.module)
TypeError: wrapper() got an unexpected keyword argument 'response'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment