From 0efb19876b0fe85aabdbb1634c8d5001e2cd2c65 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 28 Mar 2014 16:37:03 +0000 Subject: libs/sgi-uhttpd: do not assume env.CONTENT_LENGTH to be a number env.CONTENT_LENGTH as passed by uhttpd might be a string, so explicitely convert it using tonumber(). Issue has been reported by Catalin Patulea Signed-off-by: Jo-Philipp Wich --- libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/sgi-uhttpd') diff --git a/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua b/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua index 5915b69806..bca874e465 100644 --- a/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua +++ b/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua @@ -43,7 +43,7 @@ function handle_request(env) renv["HTTP_" .. k] = v end - local len = env.CONTENT_LENGTH or 0 + local len = tonumber(env.CONTENT_LENGTH) or 0 local function recv() if len > 0 then local rlen, rbuf = uhttpd.recv(4096) -- cgit v1.2.3