Copilot commented on code in PR #686:
URL:
https://github.com/apache/doris-flink-connector/pull/686#discussion_r3725435556
##########
flink-doris-connector/flink-doris-connector-base/src/main/java/org/apache/doris/flink/rest/RestService.java:
##########
@@ -211,7 +213,8 @@ private static String getConnectionGet(
HttpRequestBase request, DorisOptions dorisOptions, Logger logger)
throws IOException {
URL realUrl = new URL(request.getURI().toString());
// open connection
- HttpURLConnection connection = (HttpURLConnection)
realUrl.openConnection();
+ HttpURLConnection connection =
+ DorisHttpClientFactory.openConnection(realUrl,
dorisOptions.getTlsOptions());
connection.setRequestProperty("Authorization",
authHeader(dorisOptions));
Review Comment:
`getConnectionGet` does not disable redirects, so `HttpURLConnection` may
follow an HTTPS→HTTP redirect automatically. That can violate the PR’s stated
requirement to reject protocol-downgrade redirects (and is also inconsistent
with `getConnectionPost`, which sets `setInstanceFollowRedirects(false)`).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]