Skip to content

Commit 547c36e

Browse files
committed
fix regex expression prone to backtracking in JavaClientCodegen
1 parent 1278d58 commit 547c36e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ public void setUseRuntimeException(boolean useRuntimeException) {
615615
this.useRuntimeException = useRuntimeException;
616616
}
617617

618-
final private static Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application\\/json(;.*)?");
619-
final private static Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application\\/vnd.(.*)+json(;.*)?");
618+
private static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)application/json(;.*)?");
619+
private static final Pattern JSON_VENDOR_MIME_PATTERN = Pattern.compile("(?i)application/vnd\\..*\\+json(;.*)?");
620620

621621
/**
622622
* Check if the given MIME is a JSON MIME.

0 commit comments

Comments
 (0)