Skip to content

Commit 2673642

Browse files
Revert "feature: allow get empty key for ngx.req.get_uri(). "
This reverts commit dc14dfa.
1 parent dc14dfa commit 2673642

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/resty/core/request.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ ffi.cdef[[
9393
size_t ngx_http_lua_ffi_req_get_querystring_len(ngx_http_request_t *r);
9494

9595
int ngx_http_lua_ffi_req_get_uri_args(ngx_http_request_t *r,
96-
unsigned char *buf, ngx_http_lua_ffi_table_elt_t *out,
97-
int count, int allow_empty_key);
96+
unsigned char *buf, ngx_http_lua_ffi_table_elt_t *out, int count);
9897

9998
int ngx_http_lua_ffi_req_get_method(ngx_http_request_t *r);
10099

@@ -200,7 +199,7 @@ function ngx.req.get_headers(max_headers, raw)
200199
end
201200

202201

203-
function ngx.req.get_uri_args(max_args, tab, allow_empty_key)
202+
function ngx.req.get_uri_args(max_args, tab)
204203
local r = get_request()
205204
if not r then
206205
error("no request found")
@@ -210,8 +209,6 @@ function ngx.req.get_uri_args(max_args, tab, allow_empty_key)
210209
max_args = -1
211210
end
212211

213-
allow_empty_key = allow_empty_key or false
214-
215212
if tab then
216213
clear_tab(tab)
217214
end
@@ -230,8 +227,7 @@ function ngx.req.get_uri_args(max_args, tab, allow_empty_key)
230227
local strbuf = get_string_buf(args_len + n * table_elt_size)
231228
local kvbuf = ffi_cast(table_elt_type, strbuf + args_len)
232229

233-
local nargs = C.ngx_http_lua_ffi_req_get_uri_args(r, strbuf, kvbuf, n,
234-
allow_empty_key)
230+
local nargs = C.ngx_http_lua_ffi_req_get_uri_args(r, strbuf, kvbuf, n)
235231

236232
local args = tab or new_tab(0, nargs)
237233
for i = 0, nargs - 1 do

0 commit comments

Comments
 (0)