mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
add clause for processing given headers
This commit is contained in:
parent
05509c6c4b
commit
c6491b82a8
1 changed files with 7 additions and 2 deletions
|
@ -726,9 +726,14 @@ set_resp_header(Name, Value, Req=#{resp_headers := RespHeaders}) ->
|
|||
set_resp_header(Name,Value, Req) ->
|
||||
Req#{resp_headers => #{Name => Value}}.
|
||||
|
||||
% @todo process headers list - reduce to a map and concat the values of repeated headers, except for set-cookie that will be treated differently
|
||||
% @todo define the correct spec
|
||||
-spec set_resp_headers_list(list(term()), req())
|
||||
set_resp_headers_list(List, Req) ->
|
||||
ok.
|
||||
set_resp_headers_list([], Req) ->
|
||||
Req;
|
||||
set_resp_headers_list([{Name, Value} | Headers], Req) ->
|
||||
Req1 = set_resp_header(Name, Value, Req),
|
||||
set_resp_headers_list(Headers, Req1).
|
||||
|
||||
-spec set_resp_headers(cowboy:http_headers(), Req)
|
||||
-> Req when Req::req().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue