Skip to content

Commit

Permalink
response[header]: Raise when there are multiple values (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyuhai authored Jul 11, 2023
1 parent 2c622c5 commit 67baf3d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/req/response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ defmodule Req.Response do
case get_header(response, key) do
[value] -> {:ok, value}
[] -> :error
_ -> raise "multiple values for header #{key}, use Req.Response.get_header/2 instead"
end
end

Expand Down

0 comments on commit 67baf3d

Please sign in to comment.