moonbridge

changeset 47:1e6cf8d0e758

Bugfix: Don't read request body when sending (minimalistic) error response due to malformed requests, etc.
author jbe
date Thu Mar 19 19:13:06 2015 +0100 (2015-03-19)
parents ac37c1f28d71
children 69f4a31c6e90
files moonbridge_http.lua
line diff
     1.1 --- a/moonbridge_http.lua	Thu Mar 19 19:12:31 2015 +0100
     1.2 +++ b/moonbridge_http.lua	Thu Mar 19 19:13:06 2015 +0100
     1.3 @@ -822,6 +822,7 @@
     1.4        -- sends a minimalistic error response and enforces closing of the
     1.5        -- connection and returns the boolean value "survive"
     1.6        local function error_response(...)
     1.7 +        request:defer_reading()  -- don't read request body (because of possibly invalid state)
     1.8          request:send_status(status)
     1.9          request:send_header("Content-Type", "text/plain")
    1.10          request:send_header("Connection", "close")

Impressum / About Us