0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

Add the private add_header/3 function used by cowboy_protocol

This commit is contained in:
Loïc Hoguin 2012-09-17 00:21:33 +02:00
parent 905083a7fd
commit fc02b7f767
2 changed files with 8 additions and 2 deletions

View file

@ -105,6 +105,7 @@
%% Private setter/getter API.
-export([set_host/4]).
-export([set_connection/2]).
-export([add_header/3]).
%% Misc API.
-export([compact/1]).
@ -928,6 +929,12 @@ set_connection(RawConnection, Req=#http_req{headers=Headers}) ->
ConnAtom = cowboy_http:connection_to_atom(ConnTokens),
Req3#http_req{connection=ConnAtom}.
%% @private
-spec add_header(cowboy_http:header(), binary(), Req)
-> Req when Req::req().
add_header(Name, Value, Req=#http_req{headers=Headers}) ->
Req#http_req{headers=[{Name, Value}|Headers]}.
%% Misc API.
%% @doc Compact the request data by removing all non-system information.