Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep only the request fields the auth filters read
Seven of the twelve fields filter_open stored were never read. Naming
all twelve parameters keeps the order cgit passes them in on record.
Diffstat (limited to 'custom/extensions/auth-file.lua')
| -rw-r--r-- | custom/extensions/auth-file.lua | 26 |
1 file changed, 5 insertions, 21 deletions
diff --git a/custom/extensions/auth-file.lua b/custom/extensions/auth-file.lua index f11954a..78e5020 100644 --- a/custom/extensions/auth-file.lua +++ b/custom/extensions/auth-file.lua @@ -545,33 +545,17 @@ function body() return 0 end --- filter_open unpacks the action and request fields cgit passes in fixed --- order, filter_write collects a post body, and filter_close runs the action. - local actions = {} actions["authenticate-post"] = authenticate_post actions["authenticate-cookie"] = authenticate_cookie actions["body"] = body -function filter_open(...) - action = actions[select(1, ...)] - +function filter_open(name, cookie, method, query, referer, path, host, https, + repo, page, url, login) + action = actions[name] post = {} - - http = {} - http["cookie"] = select(2, ...) - http["method"] = select(3, ...) - http["query"] = select(4, ...) - http["referer"] = select(5, ...) - http["path"] = select(6, ...) - http["host"] = select(7, ...) - http["https"] = select(8, ...) - - cgit = {} - cgit["repo"] = select(9, ...) - cgit["page"] = select(10, ...) - cgit["url"] = select(11, ...) - cgit["login"] = select(12, ...) + http = { cookie = cookie } + cgit = { repo = repo, url = url, login = login } end function filter_close() |
