mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 13:10:24 +00:00
Add 'Accept' header parsing
Rework the cowboy_http_req:parse_header/2 function while I was at it.
This commit is contained in:
parent
1a839954bb
commit
c605c4fa40
4 changed files with 259 additions and 37 deletions
|
@ -172,7 +172,7 @@ header({http_header, _I, 'Host', _R, _V}, Req, State) ->
|
|||
header({http_header, _I, 'Connection', _R, Connection},
|
||||
Req=#http_req{headers=Headers}, State) ->
|
||||
Req2 = Req#http_req{headers=[{'Connection', Connection}|Headers]},
|
||||
{tokens, ConnTokens, Req3}
|
||||
{ConnTokens, Req3}
|
||||
= cowboy_http_req:parse_header('Connection', Req2),
|
||||
ConnAtom = cowboy_http:connection_to_atom(ConnTokens),
|
||||
parse_header(Req3#http_req{connection=ConnAtom}, State);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue