Skip to content

Commit 03c9b34

Browse files
Remove debug log, fix err msg
1 parent 44318c0 commit 03c9b34

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ngx_http_auth_jwt_module.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,16 @@ static ngx_int_t ngx_http_auth_jwt_handler(ngx_http_request_t *r)
199199
else if ( auth_jwt_algorithm.len == sizeof("RS256") - 1 && ngx_strncmp(auth_jwt_algorithm.data, "RS256", sizeof("RS256") - 1) == 0 )
200200
{
201201
// in this case, 'Binary' is a misnomer, as it is the public key string itself
202-
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "failed to find a jwt");
203202
if (jwtcf->auth_jwt_use_keyfile == 1)
204203
{
205-
FILE *file = fopen((const char*)jwtcf->auth_jwt_keyfile_path.data, "rb");
204+
FILE *file = fopen((const char*)jwtcf->auth_jwt_keyfile_path.data, "r");
206205

207206
// Check if file exists or is correctly opened
208207
if (file == NULL)
209208
{
210209
char err[100];
211210
strcpy(err, "failed to open pub key file: ");
212-
strcat(err, KEY_FILE_PATH);
211+
strcat(err, (const char*)jwtcf->auth_jwt_keyfile_path.data);
213212
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, err);
214213
goto redirect;
215214
}

0 commit comments

Comments
 (0)