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

Chalice does not respect authorizer header argument locally #1976

Open
saedx1 opened this issue Sep 7, 2022 · 0 comments
Open

Chalice does not respect authorizer header argument locally #1976

saedx1 opened this issue Sep 7, 2022 · 0 comments

Comments

@saedx1
Copy link

saedx1 commented Sep 7, 2022

Hi,

I've noticed that if you specify a header for the authorizer and try it locally it won't work; it will still check for the Authorization header rather than the header I specified.

Example:

@app.authorizer(header="Cookie")
def authorizer(auth_request):
    token = auth_request.token

Here, it will not respect "Cookie" and use it as the header for authorization. It will still go for "Authorization".

I dug a little bit, and it turned out that it's fixed to Authorization in the code itself.

The behavior is correct when you deploy; the problem is only present locally.

I'm making a PR to create a fix for it.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant