fjtirado commented on code in PR #4139:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4139#discussion_r2581406553
##########
kogito-workitems/kogito-rest-workitem/src/main/java/org/kogito/workitem/rest/RestWorkItemHandler.java:
##########
@@ -162,28 +164,24 @@ public Optional<WorkItemTransition>
activateWorkItemHandler(KogitoWorkItemManage
} catch (MalformedURLException ex) {
logger.debug("Parameter endpoint {} is not valid uri {}",
endPoint, ex.getMessage());
}
-
if (isEmpty(protocol)) {
- protocol = getParam(parameters, PROTOCOL, String.class, "http");
- logger.debug("Protocol not specified, using {}", protocol);
+ protocol = getParam(parameters, PROTOCOL);
}
-
- boolean isSsl = protocol.equalsIgnoreCase("https");
-
if (isEmpty(host)) {
host = getParam(parameters, HOST, String.class, "localhost");
- logger.debug("Host not specified, using {}", host);
}
if (port == -1) {
- port = getParam(parameters, PORT, Integer.class, isSsl ?
DEFAULT_SSL_PORT : DEFAULT_PORT);
- logger.debug("Port not specified, using {}", port);
+ port = getParam(parameters, PORT, Integer.class, isHttps(protocol)
? DEFAULT_SSL_PORT : DEFAULT_PORT);
}
if (isEmpty(path)) {
path = endPoint;
logger.debug("Path is empty, using whole endpoint {}", endPoint);
}
+ if (isEmpty(protocol)) {
+ protocol = port == DEFAULT_SSL_PORT ? HTTPS_PROTOCOL :
HTTP_PROTOCOL;
Review Comment:
This infers the protocol (if not specified) from the specified port.
--
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]