Problem
In Service.java, the createBaseURL method uses String.replaceFirst() with domain strings that contain unescaped dots (e.g. https://device-api-test.adyen.com).
Since replaceFirst takes a regular expression, each . matches any character rather than a literal dot. This means a URL like https://device-api-testXadyenYcom would be incorrectly matched and transformed.
Affected blocks
The following replaceFirst calls all have this issue:
pal- block: https://pal-test.adyen.com/pal/servlet/
paltokenization- block: https://paltokenization-test.adyen.com/paltokenization/servlet/
checkout- block: https://checkout-test.adyen.com/
device-api- block: https://device-api-test.adyen.com
Fix
Escape the dots in each regex pattern, e.g.:
url = url.replaceFirst("https://device-api-test\\.adyen\\.com", "https://device-api-live.adyen.com");
Or use String.replace() instead of replaceFirst() where no regex features are needed, since these are all plain prefix substitutions on well-known URL strings.
Problem
In
Service.java, thecreateBaseURLmethod usesString.replaceFirst()with domain strings that contain unescaped dots (e.g.https://device-api-test.adyen.com).Since
replaceFirsttakes a regular expression, each.matches any character rather than a literal dot. This means a URL likehttps://device-api-testXadyenYcomwould be incorrectly matched and transformed.Affected blocks
The following
replaceFirstcalls all have this issue:pal-block:https://pal-test.adyen.com/pal/servlet/paltokenization-block:https://paltokenization-test.adyen.com/paltokenization/servlet/checkout-block:https://checkout-test.adyen.com/device-api-block:https://device-api-test.adyen.comFix
Escape the dots in each regex pattern, e.g.:
Or use
String.replace()instead ofreplaceFirst()where no regex features are needed, since these are all plain prefix substitutions on well-known URL strings.