Updated Branches:
refs/heads/malformed_request_line [created] ffa34b285
Respond with a 400 if Request-URI is invalid
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ffa34b28
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ffa34b28
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ffa34b28
Branch: refs/heads/malformed_request_line
Commit: ffa34b285928bf5225a81fb6b347b39c727d0cc3
Parents: c4ee89e
Author: Robert Newson <rnewson@apache.org>
Authored: Tue Dec 25 10:57:25 2012 +0000
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Dec 25 10:57:25 2012 +0000
----------------------------------------------------------------------
src/mochiweb/mochiweb_http.erl | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/ffa34b28/src/mochiweb/mochiweb_http.erl
----------------------------------------------------------------------
diff --git a/src/mochiweb/mochiweb_http.erl b/src/mochiweb/mochiweb_http.erl
index 23a4752..72bf8a6 100644
--- a/src/mochiweb/mochiweb_http.erl
+++ b/src/mochiweb/mochiweb_http.erl
@@ -102,7 +102,13 @@ loop(Socket, Body) ->
request(Socket, Body) ->
mochiweb_socket:setopts(Socket, [{active, once}]),
receive
- {Protocol, _, {http_request, Method, Path, Version}} when Protocol == http orelse
Protocol == ssl ->
+ {Protocol, _, {http_request, Method, {abs_path, _}=Path, Version}} when Protocol
== http orelse Protocol == ssl ->
+ mochiweb_socket:setopts(Socket, [{packet, httph}]),
+ headers(Socket, {Method, Path, Version}, [], Body, 0);
+ {Protocol, _, {http_request, Method, {absoluteURI, _, _, _, _}=Path, Version}} when
Protocol == http orelse Protocol == ssl ->
+ mochiweb_socket:setopts(Socket, [{packet, httph}]),
+ headers(Socket, {Method, Path, Version}, [], Body, 0);
+ {Protocol, _, {http_request, Method, '*'=Path, Version}} when Protocol == http orelse
Protocol == ssl ->
mochiweb_socket:setopts(Socket, [{packet, httph}]),
headers(Socket, {Method, Path, Version}, [], Body, 0);
{Protocol, _, {http_error, "\r\n"}} when Protocol == http orelse Protocol == ssl
->
|