aboutsummaryrefslogtreecommitdiffstats
path: root/net/httpserver.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-01-21 13:10:13 +0000
committerMatthew Wild <mwild1@gmail.com>2010-01-21 13:10:13 +0000
commit4c3707ec7bb896d1efaccf63eed18aee8cd88ef8 (patch)
tree13734c51d76c84060e701335d0b04d9fbfc482c2 /net/httpserver.lua
parent649aefc28e661f4c89f49e6600646de4a673b99c (diff)
downloadprosody-4c3707ec7bb896d1efaccf63eed18aee8cd88ef8.tar.gz
prosody-4c3707ec7bb896d1efaccf63eed18aee8cd88ef8.zip
net.httpserver: Close connection on invalid HTTP status line
Diffstat (limited to 'net/httpserver.lua')
-rw-r--r--net/httpserver.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/httpserver.lua b/net/httpserver.lua
index ddb4475c..1341bfbb 100644
--- a/net/httpserver.lua
+++ b/net/httpserver.lua
@@ -175,7 +175,10 @@ local function request_reader(request, data, startpos)
log("debug", "Reading request line...")
local method, path, http, linelen = data:match("^(%S+) (%S+) HTTP/(%S+)\r\n()", startpos);
if not method then
- return call_callback(request, "invalid-status-line");
+ log("warn", "Invalid HTTP status line, telling callback then closing");
+ local ret = call_callback(request, "invalid-status-line");
+ request:destroy();
+ return ret;
end
request.method, request.path, request.httpversion = method, path, http;