0
Fork 0
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:
Loïc Hoguin 2011-10-26 04:07:08 +02:00
parent 1a839954bb
commit c605c4fa40
4 changed files with 259 additions and 37 deletions

View file

@ -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);