Skip to content

Commit bfec31c

Browse files
committed
Fix ui_rewrite error when the regex in config is empty
1 parent 8ccaa53 commit bfec31c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

VeryNginx/lua_script/module/uri_rewrite.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function _M.run()
3131
local matcher = matcher_list[ rule['matcher'] ]
3232
if enable == true and request_tester.test( matcher ) == true then
3333
replace_re = rule['replace_re']
34-
if replace_re ~= nil then
34+
if replace_re ~= nil and string.len( replace_re ) then
3535
new_uri = re_gsub( ngx_var_uri, replace_re, rule['to_uri'] )
3636
else
3737
new_uri = rule['to_uri']

0 commit comments

Comments
 (0)