Skip to content

Chalice does not respect authorizer header argument locally #1976

@saedx1

Description

@saedx1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions