Skip to content

Commit

Permalink
HTTP header names are case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
pini-gh committed Mar 22, 2021
1 parent 80f564c commit 62a7f53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tmate/util/json_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule Tmate.Util.JsonApi do
end

def process_response(%Response{headers: headers, body: body} = response) do
content_type_hdr = Enum.find(headers, fn {name, _} -> name == "content-type" end)
content_type_hdr = Enum.find(headers, fn {name, _} -> String.downcase(name) == "content-type" end)
body = case content_type_hdr do
{_, "application/json" <> _} -> Jason.decode!(body)
_ -> body
Expand Down

0 comments on commit 62a7f53

Please sign in to comment.