Skip to content

Commit e8e0f09

Browse files
committed
HTTP header names are case insensitive
1 parent d95a4b7 commit e8e0f09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/tmate/util/json_api.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ defmodule Tmate.Util.JsonApi do
3232
end
3333

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

0 commit comments

Comments
 (0)