gnodet-bot commented on code in PR #27945:
URL: https://github.com/apache/camel/pull/27945#discussion_r4312022558


##########
components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/handlers/HttpServerChannelHandler.java:
##########
@@ -223,14 +239,79 @@ private String extractTarget(URI uri) {
         // strip the starting endpoint path so the target is relative to the 
endpoint uri.
         // the comparison must ignore case on the context-path, the same way 
consumer dispatch does
         // (RestConsumerContextPathMatcher), so the security constraint is 
evaluated against the same
-        // normalized target the request is actually routed to
+        // target the request is actually routed to
         String path = consumer.getConfiguration().getPath();
         if (path != null && 
target.toLowerCase(Locale.US).startsWith(path.toLowerCase(Locale.US))) {
             target = target.substring(path.length());
         }
         return target;
     }
 
+    /**
+     * Whether the path contains a {@code .} or {@code ..} segment that path 
normalization would resolve. Such a path is
+     * resolved differently by the security constraint, the consumer dispatch 
and the route, so it is rejected up front

Review Comment:
   💡 **Nit:** The Javadoc still uses the old phrasing "resolved differently" 
from the previous iteration — the wording update to "may each interpret it 
differently" was applied to the `channelRead0` comment and the upgrade guide 
but not here.
   
   ```suggestion
        * resolved differently by the security constraint, the consumer 
dispatch and the route, so it is rejected up front
   ```
   
   Should be:
   ```
        * interpreted differently by the security constraint, the consumer 
dispatch and the route, so it is rejected up front
   ```



##########
components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthConstraintDotSegmentTest.java:
##########
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.netty.http;
+
+import org.apache.camel.BindToRegistry;
+import org.apache.camel.CamelExecutionException;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.camel.test.junit6.TestSupport.assertIsInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+/**
+ * A request path containing {@code .} or {@code ..} segments is resolved 
differently by the security constraint, the

Review Comment:
   💡 **Nit:** Same inconsistency — class Javadoc still says "resolved 
differently" while the code comment and upgrade guide now say "may each 
interpret it differently".
   
   ```suggestion
    * A request path containing {@code .} or {@code ..} segments is resolved 
differently by the security constraint, the
   ```
   
   Should use:
   ```
    * A request path containing {@code .} or {@code ..} segments may be 
interpreted differently by the security constraint, the
   ```



-- 
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]

Reply via email to