Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support regex_uri with unsafe_uri in proxy-rewrite #9813

Merged
merged 6 commits into from
Jul 14, 2023

Conversation

Revolyssup
Copy link
Contributor

@Revolyssup Revolyssup commented Jul 11, 2023

Description

Fixes #9638
Tests to be added

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
@monkeyDluffy6017
Copy link
Contributor

Please fix the code lint

@monkeyDluffy6017 monkeyDluffy6017 added the wait for update wait for the author's response in this issue/PR label Jul 11, 2023
Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
@Revolyssup
Copy link
Contributor Author

Please fix the code lint

@monkeyDluffy6017 Done. Please approve CI

Comment on lines 353 to 363
if conf.use_real_request_uri_unsafe and conf.regex_uri then
local index
if separator_escaped then
index = str_find(upstream_uri,"?")
end
if index then
upstream_uri = sub_str(upstream_uri, 1, index - 1)
..sub_str(upstream_uri,index)
end
ctx.var.upstream_uri = upstream_uri
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you add these code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, in the if block above this when the safe encoding was on then this logic was added to first remove the ? and then readd after safely encoding. When we're skipping the safe encoding then we don't need to do any of that but I added it by mistake. Removed this.

Signed-off-by: revolyssup <ashishjaitiwari15112000@gmail.com>
AlinsRan
AlinsRan previously approved these changes Jul 14, 2023
Copy link
Contributor

@monkeyDluffy6017 monkeyDluffy6017 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add blank around the new code block

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
@Revolyssup
Copy link
Contributor Author

Please add blank around the new code block

done

@monkeyDluffy6017 monkeyDluffy6017 added approved and removed wait for update wait for the author's response in this issue/PR labels Jul 14, 2023
@monkeyDluffy6017 monkeyDluffy6017 merged commit 2b71d8f into apache:master Jul 14, 2023
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

help request: How to use proxy-pass plugin with regex_uri attributes when the url is encoded
4 participants