openwrt luci.http 请求有最大接收请求限制吗

我在openwrt中luci.http接收http json格式请求,消息体大小超过8192字节后就收不到后续的内容了。 使用http.content获取最大8192字节,后续被截断了。

local http=require "luci.http"
local data , dataLength=http.content()
http.write(tostring(dataLength))
 

输出8192, 我的content-length远远超过这个值

阅读 5k
1 个回答

查看了下luci的源码
github地址: https://github.com/openwrt/lu...
luci/modules/luci-base/luasrc/http.lua

有关于body的限制

local table, ipairs, pairs, type, tostring, tonumber, error =
    table, ipairs, pairs, type, tostring, tonumber, error

module "luci.http"

HTTP_MAX_CONTENT      = 1024*100        -- 100 kB maximum content size

context = util.threadlocal()

其中这个方法parse_message_body里面

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题