Skip to content

Commit

Permalink
Change url regex
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <[email protected]>
  • Loading branch information
zane-neo committed Feb 20, 2024
1 parent 689c2cb commit 0641bc4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ public static SdkHttpFullRequest buildSdkRequest(
SdkHttpMethod method
) throws UnknownHostException {
String endpoint = connector.getPredictEndpoint(parameters);
Pattern pattern = Pattern.compile("(?:(\\w+)://)?((\\w+\\.)*\\w+)(?::(\\w+))?");
Pattern pattern = Pattern.compile("(?:(\\w+)://)?([-a-zA-Z0-9+&@#%?=~_|!,.;]*)(?::(\\w+))?");
Matcher matcher = pattern.matcher(endpoint);
if (matcher.find()) {
String protocol = matcher.group(1);
String host = matcher.group(2);
String port = matcher.group(4);
String port = matcher.group(3);
MLHttpClientFactory.validate(protocol, host, port);
} else {
throw new IllegalArgumentException("Invalid endpoint: " + endpoint);
Expand Down

0 comments on commit 0641bc4

Please sign in to comment.