Skip to content

Commit eb98a5a

Browse files
authored
Enhance regex pattern for URL matching
1 parent ad6ff5e commit eb98a5a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/com/iemr/admin/utils/JwtUserIdValidationFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ private boolean isOriginAllowed(String origin) {
185185
.anyMatch(pattern -> {
186186
String regex = pattern
187187
.replace(".", "\\.")
188-
.replace("*", ".*");
188+
.replace("*", ".*")
189+
.replace("http://localhost:.*", "http://localhost:\\d+");
189190

190191
boolean matched = origin.matches(regex);
191192
return matched;

0 commit comments

Comments
 (0)