Skip to content

Commit

Permalink
Prevent double slashes when concatenating URLs (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen authored Oct 17, 2023
1 parent b8d4c10 commit 77165ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/oidcc_provider_configuration.erl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ load_configuration(Issuer0, Opts) ->
Issuer = binary:list_to_bin([Issuer0]),
TelemetryOpts = #{topic => [oidcc, load_configuration], extra_meta => #{issuer => Issuer}},
RequestOpts = maps:get(request_opts, Opts, #{}),
Request = {[Issuer, <<"/.well-known/openid-configuration">>], []},

RequestUrl = uri_string:resolve(".well-known/openid-configuration", Issuer),
Request = {RequestUrl, []},

maybe
{ok, {{json, ConfigurationMap}, Headers}} ?=
Expand Down
9 changes: 9 additions & 0 deletions test/oidcc_provider_configuration_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,13 @@ load_well_known_openid_introspections(_Config) ->
)
),

%% Auth0
?assertMatch(
{ok, {#oidcc_provider_configuration{}, _}},
oidcc_provider_configuration:load_configuration(
<<"https://dev-key.us.auth0.com/">>,
#{}
)
),

ok.

0 comments on commit 77165ca

Please sign in to comment.