Copilot commented on code in PR #11386:
URL: https://github.com/apache/cloudstack/pull/11386#discussion_r2250754376


##########
client/src/main/java/org/apache/cloudstack/ServerDaemon.java:
##########
@@ -207,6 +211,21 @@ public void start() throws Exception {
         server.join();
     }
 
+    /**
+     * Adds a ForwardedRequestCustomizer to the HTTP configuration to handle 
forwarded headers.
+     * The header used for forwarding is determined by the 
ApiServer.listOfForwardHeaders property.
+     * Only non empty headers are considdered and only the first of the 
comma-separated list is used.

Review Comment:
   There's a spelling error in the comment. 'considdered' should be 
'considered'.
   ```suggestion
        * Only non empty headers are considered and only the first of the 
comma-separated list is used.
   ```



##########
client/src/main/java/org/apache/cloudstack/ServerDaemon.java:
##########
@@ -207,6 +211,21 @@ public void start() throws Exception {
         server.join();
     }
 
+    /**
+     * Adds a ForwardedRequestCustomizer to the HTTP configuration to handle 
forwarded headers.
+     * The header used for forwarding is determined by the 
ApiServer.listOfForwardHeaders property.
+     * Only non empty headers are considdered and only the first of the 
comma-separated list is used.
+     * @param httpConfig the HTTP configuration to which the customizer will 
be added
+     */
+    private static void addForwordingCustomiser(HttpConfiguration httpConfig) {

Review Comment:
   The method name has a spelling error. 'addForwordingCustomiser' should be 
'addForwardingCustomizer' (missing 'a' in 'Forwarding' and using American 
spelling for 'Customizer').
   ```suggestion
       private static void addForwardingCustomizer(HttpConfiguration 
httpConfig) {
   ```



##########
client/src/main/java/org/apache/cloudstack/ServerDaemon.java:
##########
@@ -185,6 +188,7 @@ public void start() throws Exception {
         httpConfig.setResponseHeaderSize(8192);
         httpConfig.setSendServerVersion(false);
         httpConfig.setSendDateHeader(false);
+        addForwordingCustomiser(httpConfig);

Review Comment:
   The method call has the same spelling error as the method definition. Should 
be 'addForwardingCustomizer'.



##########
client/src/main/java/org/apache/cloudstack/ServerDaemon.java:
##########
@@ -207,6 +211,21 @@ public void start() throws Exception {
         server.join();
     }
 
+    /**
+     * Adds a ForwardedRequestCustomizer to the HTTP configuration to handle 
forwarded headers.
+     * The header used for forwarding is determined by the 
ApiServer.listOfForwardHeaders property.
+     * Only non empty headers are considdered and only the first of the 
comma-separated list is used.
+     * @param httpConfig the HTTP configuration to which the customizer will 
be added
+     */
+    private static void addForwordingCustomiser(HttpConfiguration httpConfig) {
+        ForwardedRequestCustomizer customiser = new 
ForwardedRequestCustomizer();

Review Comment:
   [nitpick] Variable name uses British spelling 'customiser' while the class 
name uses American spelling 'Customizer'. For consistency, consider using 
'customizer'.



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