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 Jan 22, 2023
1 parent d95a4b7 commit e8e0f09
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 e8e0f09

Please sign in to comment.