gnodet commented on code in PR #26167:
URL: https://github.com/apache/camel/pull/26167#discussion_r3950137896


##########
components/camel-http/src/test/java/org/apache/camel/component/http/HttpProxyServerTest.java:
##########
@@ -143,6 +147,30 @@ public void httpGetWithProxyOnComponent() {
         assertExchange(exchange);
     }
 
+    @Test
+    public void httpsTargetWithProxyDefaultsToHttpProxyScheme() throws 
Exception {
+        // CAMEL-24632: proxy scheme must default to "http" regardless of the 
target endpoint scheme
+        HttpEndpoint endpoint = context.getEndpoint(
+                "https://www.example.com?proxyHost=myproxy&proxyPort=8080";, 
HttpEndpoint.class);
+
+        HttpClientConfigurer configurer = endpoint.getHttpClientConfigurer();
+        assertThat(configurer).isNotNull();
+
+        HttpClientBuilder builder = HttpClientBuilder.create();
+        configurer.configureHttpClient(builder);
+
+        Field proxyField = HttpClientBuilder.class.getDeclaredField("proxy");
+        proxyField.setAccessible(true);

Review Comment:
   💡 **Nit:** `Field.setAccessible(true)` on `HttpClientBuilder.proxy` couples 
this test to HC5 internals — if that field is renamed in a future HC5 release, 
this test breaks for reasons unrelated to Camel. Pragmatic for a regression 
test, but worth noting.



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