From a13c9617445423cffc5375d63bb362bbef332256 Mon Sep 17 00:00:00 2001 From: Serge Tupchii Date: Fri, 7 Jun 2024 16:32:54 +0300 Subject: [PATCH] fix(emqx_authn_jwks): add a user-agent header to jwks HTTP request --- apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src | 2 +- apps/emqx_auth_jwt/src/emqx_authn_jwks_client.erl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src b/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src index 7e313881e..eb9c9b9bb 100644 --- a/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt.app.src @@ -1,7 +1,7 @@ %% -*- mode: erlang -*- {application, emqx_auth_jwt, [ {description, "EMQX JWT Authentication and Authorization"}, - {vsn, "0.2.0"}, + {vsn, "0.2.1"}, {registered, []}, {mod, {emqx_auth_jwt_app, []}}, {applications, [ diff --git a/apps/emqx_auth_jwt/src/emqx_authn_jwks_client.erl b/apps/emqx_auth_jwt/src/emqx_authn_jwks_client.erl index dc03cafef..578d7198a 100644 --- a/apps/emqx_auth_jwt/src/emqx_authn_jwks_client.erl +++ b/apps/emqx_auth_jwt/src/emqx_authn_jwks_client.erl @@ -159,7 +159,10 @@ refresh_jwks( case httpc:request( get, - {Endpoint, [{"Accept", "application/json"}]}, + {Endpoint, [ + {"Accept", "application/json"}, + {"User-Agent", "EMQX/" ++ emqx_release:version_with_prefix()} + ]}, HTTPOpts, [{body_format, binary}, {sync, false}, {receiver, self()}] )