-
Bug
-
Resolution: Fixed
-
Major
-
7.0.7, 8.0.4.1
-
None
-
Security Level: Jimmy
-
None
-
None
Steps to Reproduce
Examples using Https.getCompleteContext(), but this issue applies to all methods in Https using indexOf to split the url
-getCompleteContext
-getCompleteServerName
-possible other methods?
Setup a ZK application where context = server name.
Easiest: App context: localhost, server = localhost
Use Https helper functions to get values from the current request such as:
String completeContext = Https.getCompleteContext(((HttpServletRequest)Executions.getCurrent().getNativeRequest()));
Actual Result
With context name = server name
getCompleteContext returns:
https://localhost
Expected Result
With context name != server name
getCompleteContext returns:
https://localhost:8443/localhostdifferent
Debug Info
Root Cause
sb.indexOf(ctx) will always return the first position of the context string. If the context string appear more than once (server name and context name) then the returned value will be incorect, as the string is cut too early