Skip to content

Commit

Permalink
fix: cud validation (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc authored Aug 1, 2023
1 parent fc8a3a8 commit 06a1969
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased]

## [6.0.8] - 2023-08-01

- Fixes CUD validation starting with number.

## [6.0.7] - 2023-07-28

- Fixes session removing for user with useridmapping when disassociating from tenant.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ compileTestJava { options.encoding = "UTF-8" }
// }
//}

version = "6.0.7"
version = "6.0.8"


repositories {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/supertokens/webserver/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static String normalizeAndValidateConnectionUriDomain(String connectionUr
throw new ServletException(new WebserverAPI.BadRequestException("connectionUriDomain should not be an empty String"));
}

String hostnameRegex = "^[a-z][a-z0-9-]+(\\.[a-z][a-z0-9-]+)*(:[0-9]+)?$";
String hostnameRegex = "^[a-z0-9-]+(\\.[a-z0-9-]+)*(:[0-9]+)?$";
String ipRegex = "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(:[0-9]+)?$";

if (!connectionUriDomain.matches(hostnameRegex) && !connectionUriDomain.matches(ipRegex)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ public void testConnectionUriDomainValidationUtil() throws Exception {
"sub-domain.example.com",
"sub-domain.example.com:3567",
"hello.co.uk",
"58hello.abc.com"
};
String[] invalidDomains = new String[]{
"http://localhost",
Expand Down

0 comments on commit 06a1969

Please sign in to comment.