Skip to content

Commit

Permalink
fix(proxy-rewrite): fix url normalization bypass
Browse files Browse the repository at this point in the history
This commit fixes a bug where ctx.var.upstream_uri is
not set when use_real_request_uri_unsafe is enabled.

It seems that somewhere in the runtime chain (LuaJIT?)
a memory jump occurs and ctx.var.upstream_uri _does_ get set
even though it definitely **shouldn't**. Hence why this got unnoticed
in the CI tests of apache#7401.

Signed-off-by: İlteriş Yağıztegin Eroğlu <ilteris.eroglu@trendyol.com>
  • Loading branch information
ilteriseroglu-ty authored Dec 23, 2022
1 parent ccffa0e commit f6d0526
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apisix/plugins/proxy-rewrite.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ do
else
ctx.var.upstream_uri = upstream_uri
end
else
ctx.var.upstream_uri = upstream_uri
end

if conf.headers then
Expand Down

0 comments on commit f6d0526

Please sign in to comment.