JingsongLi commented on code in PR #5695:
URL: https://github.com/apache/paimon/pull/5695#discussion_r2128167156
##########
paimon-api/src/main/java/org/apache/paimon/rest/HttpClient.java:
##########
@@ -173,6 +182,9 @@ public <T extends RESTResponse> T delete(
@VisibleForTesting
protected static String getRequestUrl(
String uri, String path, Map<String, String> queryParams) {
+ if (!uri.startsWith("http://") && !uri.startsWith("https://")) {
Review Comment:
We don't need this check.
##########
paimon-api/src/main/java/org/apache/paimon/rest/HttpClient.java:
##########
@@ -68,11 +68,20 @@ public class HttpClient implements RESTClient {
private ErrorHandler errorHandler;
public HttpClient(String uri) {
- if (uri != null && uri.endsWith("/")) {
- this.uri = uri.substring(0, uri.length() - 1);
+ String serverUri;
+ if (StringUtils.isNotEmpty(uri)) {
+ if (uri.endsWith("/")) {
+ serverUri = uri.substring(0, uri.length() - 1);
+ } else {
+ serverUri = uri;
+ }
+ if (!uri.startsWith("http://") && !uri.startsWith("https://")) {
+ serverUri = String.format("http://%s", serverUri);
+ }
} else {
- this.uri = uri;
+ throw new IllegalArgumentException("uri is empty which must be
define");
Review Comment:
be defined?
--
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]