luci-base: dispatcher: fix rpc controller regression
When testing the luci-rpc authnetication, avoid clobbering the HTTP post request body. Fixes: #3470 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
4b22060823
commit
38c9c9e0a2
1 changed files with 3 additions and 1 deletions
|
@ -305,7 +305,7 @@ local function tree_to_json(node, json)
|
|||
elseif subname == "rpc" and subnode.module == "luci.controller.rpc" then
|
||||
spec.auth = {
|
||||
login = false,
|
||||
methods = { "param:auth", "cookie:sysauth" }
|
||||
methods = { "query:auth", "cookie:sysauth" }
|
||||
}
|
||||
elseif subnode.module == "luci.controller.admin.uci" then
|
||||
spec.auth = {
|
||||
|
@ -546,6 +546,8 @@ local function check_authentication(method)
|
|||
sid = http.getcookie(auth_param)
|
||||
elseif auth_type == "param" then
|
||||
sid = http.formvalue(auth_param)
|
||||
elseif auth_type == "query" then
|
||||
sid = http.formvalue(auth_param, true)
|
||||
end
|
||||
|
||||
return session_retrieve(sid)
|
||||
|
|
Loading…
Reference in a new issue