Skip to content

Failed to parse JWT - suggested fix #134

@Malieux

Description

@Malieux

Hello,
First of all thanks for your work!
When using your module I came across "failed to parse JWT" error multiple times. After digging in it turns out that in Authorization header 'bearer' was not in capital letter. According to standards RFC 7235 Section 2.1 the auth-scheme part of an HTTP Authorization header is case-insensitive.
My quickfix was to change this line to
if (ngx_strncasecmp(jwtHeaderVal->value.data, (u_char *)BEARER_PREFIX, strlen(BEARER_PREFIX)) == 0)
But I'm no C developer so I believe you could fix it in more elegant way.
Thanks in advance.

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