vbhanuchander-lang commented on issue #7789: URL: https://github.com/apache/hop/issues/7789#issuecomment-5364054827
I had a look at this, and the result is slightly different from the title — worth confirming before the fix is scoped. **The proxy leg already tolerates underscores.** Both transforms hand the proxy to `HttpClientManager.HttpClientBuilderFacade#setProxy`, which does `new HttpHost(scheme, host, port)` and then sets it on `RequestConfig`. That constructor takes the host name verbatim — no URI parsing — so `my_proxy.internal` survives it, and I confirmed that against httpcore5 5.4. **The target URL does not.** `Http#processRow` and `HttpPost#processRow` both do `HttpHost.create(uri)`, and that overload reads `URI.getHost()`. When the host name contains an underscore, `java.net.URI` treats the authority as registry-based rather than server-based, so: ``` http://my_service.internal:8080/api URI.getHost() = null URI.getPort() = -1 URI.getAuthority() = my_service.internal:8080 ``` and `HttpHost.create(URI)` fails with `NullPointerException: Host name`. Same call in `WebService` and in `HttpProtocol`, so four call sites share it. So a request *through* an underscored proxy should work, while a request *to* an underscored host fails — could you confirm which of the two you actually hit? If it was the target URL then this issue covers it and I have a fix ready. If it really was the proxy, I would like to see the stack trace, because the code path I traced does not explain it and something else is going on. On the "not an allowed DNS hostname" point: strictly true, underscores are not legal in hostnames per RFC 1123, but they are common in internal networks and container DNS and they resolve fine, so failing with a NullPointerException seems the wrong outcome regardless. -- 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]
