Skip to content

Commit e6aff16

Browse files
committed
Adjust based on javi's review
Signed-off-by: Ricardo Zanini <[email protected]>
1 parent 2e338ea commit e6aff16

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

impl/core/src/main/java/io/serverlessworkflow/impl/WorkflowUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import io.serverlessworkflow.impl.schema.SchemaValidator;
3131
import io.serverlessworkflow.impl.schema.SchemaValidatorFactory;
3232
import java.net.URI;
33+
import java.net.URISyntaxException;
3334
import java.time.Duration;
3435
import java.util.Map;
3536
import java.util.Optional;
@@ -222,7 +223,7 @@ public static final String checkSecret(
222223
}
223224

224225
public static URI concatURI(URI base, String pathToAppend) {
225-
if (pathToAppend == null || pathToAppend.isEmpty()) {
226+
if (!isValid(pathToAppend)) {
226227
return base;
227228
}
228229

@@ -232,7 +233,7 @@ public static URI concatURI(URI base, String pathToAppend) {
232233
}
233234

234235
String basePath = base.getPath();
235-
if (basePath == null || basePath.isEmpty()) {
236+
if (!isValid(basePath)) {
236237
basePath = "/";
237238
} else if (!basePath.endsWith("/")) {
238239
basePath = basePath + "/";
@@ -253,7 +254,7 @@ public static URI concatURI(URI base, String pathToAppend) {
253254

254255
try {
255256
return new URI(base.getScheme(), base.getAuthority(), finalPath, query, fragment);
256-
} catch (Exception e) {
257+
} catch (URISyntaxException e) {
257258
throw new IllegalArgumentException(
258259
"Failed to build combined URI from base=" + base + " and path=" + pathToAppend, e);
259260
}

0 commit comments

Comments
 (0)