cziegeler commented on code in PR #101:
URL:
https://github.com/apache/sling-org-apache-sling-engine/pull/101#discussion_r4142799328
##########
src/main/java/org/apache/sling/engine/impl/request/RequestData.java:
##########
@@ -240,6 +258,34 @@ public Resource initResource(ResourceResolver
resourceResolver) {
return resource;
}
+ /**
+ * Removes URL path parameters ({@code ;name=value}, scoped to a path
segment as per
+ * RFC 3986) from the given path. Used to verify that a path re-derived
from the raw
+ * request URL only differs from the container provided path info by the
path
+ * parameters it preserves.
+ *
+ * @param path the path to strip path parameters from
+ * @return the path without path parameters
+ */
+ static String stripPathParameters(final String path) {
+ if (path.indexOf(';') < 0) {
Review Comment:
Minor issue, but this call already calculates the first index for the
semi-colon, so why not use it instead of iterating again from the start?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]