From 67baf3de84bac8b28201c722aaef31454dd73b50 Mon Sep 17 00:00:00 2001 From: Burak Date: Tue, 11 Jul 2023 09:18:10 +0200 Subject: [PATCH] `response[header]`: Raise when there are multiple values (#199) --- lib/req/response.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/req/response.ex b/lib/req/response.ex index 1ba13a6b..5f279dc6 100644 --- a/lib/req/response.ex +++ b/lib/req/response.ex @@ -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