cowboy_rest dislikes invalid content-type #485

dvv opened this Issue Mar 31, 2013 · 7 comments

3 participants


Unparsable content-type headers drops the flow.
IMHO here one expects some kind of soft error.


May be

            case cowboy_req:parse_header(<<"content-type">>, Req2) of
                {ok, ContentType, Req3} ->
                    choose_content_type(Req3, State2, OnTrue, ContentType, CTA2);
                _ ->
                    respond(Req2, State2, 415)

I am not sure if this is relevant, but I had some trouble with headers becuase I used lower case.
Seems like the new cowboy code is case sensitive. <<"Content-Type">>.

dvv commented Apr 1, 2013

the issue because of two content type headers are glued together by intermediary or malicious user in one comma separated header which is semanticaly invalid here but valid syntactically

dvv commented Apr 4, 2013

a fix proposed at dvv@18ac883

Nine Nines member

Please put the State2 line back, also pass it in respond/3 and open a PR.

Nine Nines member

Closing, thanks!

@essen essen closed this Apr 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment