desruisseaux commented on code in PR #40:
URL: https://github.com/apache/sis/pull/40#discussion_r2902588937


##########
endorsed/src/org.apache.sis.cloud.aws/main/org/apache/sis/cloud/aws/s3/KeyPath.java:
##########
@@ -704,7 +705,19 @@ public URI toUri() {
             path = sb.toString();
         }
         try {
-            return new URI(SCHEME, fs.accessKey, bucket, -1, path, null, null);
+            if (fs != null) {
+                /*
+                 * We can address two different URI formats, depending on 
whether the file system is self-hosted or not:
+                 * - Self-Hosted path : s3://accessKey@host:port/bucket/key
+                 * - AWS path : s3://accessKey@bucket/key
+                 */
+                boolean selfHosted = fs.host != null && fs.port >= 0;

Review Comment:
   With this condition, either the URI has a host **and** a port, or either it 
has none of them. If only one of them is specified, this is silently ignored. 
But is it really illegal to specify only a host with a default port number? The 
implementation of `toString()` just below this method suggests that it is legal.



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