Skip to content

Commit 0fa05d9

Browse files
author
a.i.kuleshov
committed
feat: temporary use token instead Bearer prefix for Authorization header
1 parent d296c23 commit 0fa05d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ngx_http_auth_jwt_module.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,13 @@ static char * getJwt(ngx_http_request_t *r, ngx_str_t auth_jwt_validation_type)
528528
{
529529
ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, "Found authorization header len %d", authorizationHeader->value.len);
530530

531-
bearer_length = authorizationHeader->value.len - (sizeof("Bearer ") - 1);
531+
// TODO use config: AUTHORIZATION=prefix
532+
bearer_length = authorizationHeader->value.len - (sizeof("token ") - 1);
532533

533534
if (bearer_length > 0)
534535
{
535-
authorizationHeaderStr.data = authorizationHeader->value.data + sizeof("Bearer ") - 1;
536+
// TODO use config: AUTHORIZATION=prefix
537+
authorizationHeaderStr.data = authorizationHeader->value.data + sizeof("token ") - 1;
536538
authorizationHeaderStr.len = bearer_length;
537539

538540
jwtPtr = ngx_str_t_to_char_ptr(r->pool, authorizationHeaderStr);

0 commit comments

Comments
 (0)