-
Notifications
You must be signed in to change notification settings - Fork 2
fix: httproute matching #121
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -422,7 +422,14 @@ func (t *Translator) translateGatewayHTTPRouteMatch(match *gatewayv1.HTTPRouteMa | |||||||||
| case gatewayv1.PathMatchExact: | ||||||||||
| route.Uris = []string{*match.Path.Value} | ||||||||||
| case gatewayv1.PathMatchPathPrefix: | ||||||||||
| route.Uris = []string{*match.Path.Value + "*"} | ||||||||||
| pathValue := *match.Path.Value | ||||||||||
| route.Uris = []string{pathValue} | ||||||||||
|
|
||||||||||
|
||||||||||
| // If the path ends with a slash, append "*" to match all subpaths. | |
| // Otherwise, append "/*" to match the path itself and all its subpaths. |
Copilot
AI
May 6, 2025
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.
[nitpick] The default assignment of the header match type improves clarity, but adding a brief comment explaining this default value could help future maintainers understand the decision process.
| // Default to HeaderMatchExact if no specific header match type is provided. |
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.
The new logic separates the original path and its wildcard extension into two URIs. Please add inline documentation to clarify the intent and ensure that this change aligns with the expected backend matching behavior.