-
Notifications
You must be signed in to change notification settings - Fork 690
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
introduce MergePathStrategy for #521 #519 #523
Conversation
I need this as soon as possible :) Please merge and release new version |
route_builder.go
Outdated
// MergePathStrategy is the active strategy for merging a Route path when building the routing of all WebServices. | ||
// The value is set to TrimSlashStrategy | ||
// PathJoinStrategy is an alternative strategy that is more strict [Security - PRISMA-2022-0227] | ||
MergePathStrategy = TrimSlashStrategy |
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.
I think you need to set it to PathJoinStrategy
as default
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.
yes, agree. Reason for it is because that will fix the security issue that motivated the change (which turned out to be a breaking one).
README.md
Outdated
@@ -96,6 +96,10 @@ There are several hooks to customize the behavior of the go-restful package. | |||
- Compression | |||
- Encoders for other serializers | |||
- Use [jsoniter](https://github.com/json-iterator/go) by building this package using a build tag, e.g. `go build -tags=jsoniter .` | |||
- Use the variable `MergePathStrategy` to change the behaviour of composing the Route path given a root path and a local route path | |||
- versions >= 3.10.1 has set the value to `PathJoinStrategy` that fixes a reported security issue but may cause your services not to work correctly anymore. |
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.
could you please add a link to the issue that was fixed?
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.
LGTM
but I still don't understand how this PR #520 is related to that issue
Fix regression in legacy API prefix, until upstream pulls in support for MergePathStrategy from emicklei/go-restful#523 Signed-off-by: Brad Davidson <[email protected]>
Fix regression in legacy API prefix, until upstream pulls in support for MergePathStrategy from emicklei/go-restful#523 Signed-off-by: Brad Davidson <[email protected]>
Fix regression in legacy API prefix, until upstream pulls in support for MergePathStrategy from emicklei/go-restful#523 Signed-off-by: Brad Davidson <[email protected]>
Fix regression in legacy API prefix, until upstream pulls in support for MergePathStrategy from emicklei/go-restful#523 Signed-off-by: Brad Davidson <[email protected]>
* allow multiple samples for Write, issue #514 * update changelog * chore: example handling request parameters with httpin (#518) * use path package to join slash fragments #519 (#520) * update hist * update example openapi to use 3.10.1 * Add test for client request with and without trailing slash. (#522) * Add test for client request with and without trailing slash. * Correction. * introduce MergePathStrategy * Revert "introduce MergePathStrategy" This reverts commit 709cf80. * introduce MergePathStrategy for #521 #519 (#523) * introduce MergePathStrategy for #521 #519 * update readme, set default to new strategy, add extra test * link to security issue * update change hist * add hello world with TrimSlashStrategy * two route example * examples to show differences #519 * more route examples #519 * add examples for issue519 with path in root * remove obsolete swagger example * Update README.md remover swagger12 mention * allow multiple samples for Write, issue #514 --------- Co-authored-by: Ggicci <[email protected]> Co-authored-by: Gerrit <[email protected]>
No description provided.