From 0ce16b3cea25187914df89224c4e204b7715420e Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Sat, 27 Oct 2012 02:36:33 +0400 Subject: Return "400 Bad Request" instead of crashing process on incorrect queries like /%qq --- src/cowboy_protocol.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/cowboy_protocol.erl') diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl index c5ea561..df2e963 100644 --- a/src/cowboy_protocol.erl +++ b/src/cowboy_protocol.erl @@ -464,6 +464,8 @@ dispatch(Req, State=#state{dispatch=Dispatch}, Host, Path) -> handler_init(Req2, State, Handler, Opts); {error, notfound, host} -> error_terminate(400, State); + {error, badrequest, path} -> + error_terminate(400, State); {error, notfound, path} -> error_terminate(404, State) end. -- cgit v1.2.3