Skip to content

Commit 1cb7a30

Browse files
committed
fix: syntax of table.insert() to pass the correct arguments
See explanation at https://stackoverflow.com/questions/41537733/lua-table-insert-does-not-accept-a-string-parameter.
1 parent 4bcb983 commit 1cb7a30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

htaccess.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,13 +748,13 @@ local replace_server_vars = function(str, track_used_headers)
748748
if first_five == 'http_' then -- %{HTTC_*}, e.g. %{HTTC_HOST}
749749
replace = ngx.var[svar] or ''
750750
if track_used_headers then
751-
table.insert(used_headers, svar:sub(6):gsub('_', '-'):lower())
751+
table.insert(used_headers, (svar:sub(6):gsub('_', '-'):lower()))
752752
end
753753
elseif first_five == 'http:' then -- %{HTTP:*}, e.g. %{HTTP:Content-Type}
754754
svar = svar:sub(6):gsub('-','_'):lower()
755755
replace = ngx.var['http_'..svar] or ''
756756
if track_used_headers then
757-
table.insert(used_headers, svar:gsub('_', '-'))
757+
table.insert(used_headers, (svar:gsub('_', '-')))
758758
end
759759
elseif first_five == 'time_' then -- %{TIME_*}, e.g. %{TIME_YEAR}
760760
svar = svar:sub(6)

0 commit comments

Comments
 (0)