projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de5da20
)
libs/sgi-uhttpd: do not assume env.CONTENT_LENGTH to be a number
author
Jo-Philipp Wich
<jow@openwrt.org>
Fri, 28 Mar 2014 16:37:03 +0000
(16:37 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Fri, 28 Mar 2014 16:37:03 +0000
(16:37 +0000)
env.CONTENT_LENGTH as passed by uhttpd might be a string, so explicitely
convert it using tonumber().
Issue has been reported by Catalin Patulea <cat@vv.carleton.ca>
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua
patch
|
blob
|
history
diff --git
a/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua
b/libs/sgi-uhttpd/luasrc/sgi/uhttpd.lua
index 5915b698061d33ad45829c68569d95e192481218..bca874e46547c3143ce917f4fcf6185ebdd9afef 100644
(file)
--- 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)