Skip to content

Commit

Permalink
Support application/jwk-set+json content-type (#352)
Browse files Browse the repository at this point in the history
Some providers will return this content-type, which is just a JSON
content-type with stronger guarantees, so it's safe to just treat it as
regular JSON

https://webconcepts.info/concepts/media-type/application/jwk-set+json
  • Loading branch information
caioaao authored May 29, 2024
1 parent 2991142 commit ad35792
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/oidcc_http_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ extract_successful_response({{_HttpVersion, StatusCode, _HttpStatusName}, Header
-spec fetch_content_type(Headers) -> json | jwt | unknown when Headers :: [http_header()].
fetch_content_type(Headers) ->
case proplists:lookup("content-type", Headers) of
{"content-type", "application/jwk-set+json" ++ _Rest} ->
json;
{"content-type", "application/json" ++ _Rest} ->
json;
{"content-type", "application/jwt" ++ _Rest} ->
Expand Down

0 comments on commit ad35792

Please sign in to comment.