-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[feat gw-api]modify ReplacePrefixMatch support #4457
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
base: AGAController
Are you sure you want to change the base?
[feat gw-api]modify ReplacePrefixMatch support #4457
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: shuqz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5abaea3 to
a9e59cc
Compare
| pathVariable := "/#{path}" | ||
| path = &pathVariable | ||
| } else { | ||
| path = filter.Path.ReplacePrefixMatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this different than a full path replacement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, i meant path = filter.Path.ReplacePrefixMatch + /* i will update it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, though path = filter.Path.ReplacePrefixMatch + /* makes more sense logically, but it will fail cases like below
- matches:
- path:
type: PathPrefix
value: /path-and-status
filters:
- type: RequestRedirect
requestRedirect:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /replacement-prefix
statusCode: 301
does it brings more value to have path = filter.Path.ReplacePrefixMatch + /*? if not, we can leave it same as full path replacement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
synced offline, updated
Description
ReplacePrefixMatchin Filtertype: RequestRedirectwith limitation. we can still supportReplaceFullPathChecklist
README.md, or thedocsdirectory)manifest:
Test 1: Request to exact prefix (no suffix)
Test 2: Request with path suffix
Test 3: Request with deeper path
Conformance test
test failed because rules are sorted by precedence order first, and the 3nd rule causes redirect loop and we error out from api, so following rules does not got created at all.
e2e test
BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯