Skip to content

Commit b7ae93f

Browse files
authored
fix: check for correct URI pattern (#1732)
Signed-off-by: achmelo <a.chmelo@gmail.com>
1 parent 85b5948 commit b7ae93f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gateway-service/src/main/java/org/zowe/apiml/gateway/filters/pre/PerServiceGZipFilter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
8585
private boolean requiresCompression(HttpServletRequest request) {
8686
String[] uriParts = request.getRequestURI().split("/");
8787
List<ServiceInstance> instances;
88+
if (uriParts.length < 2) {
89+
return false;
90+
}
8891
if ("api".equals(uriParts[1]) || "ui".equals(uriParts[1])) {
92+
if (uriParts.length < 4) {
93+
return false;
94+
}
8995
instances = discoveryClient.getInstances(uriParts[3]);
9096
} else {
9197
instances = discoveryClient.getInstances(uriParts[1]);

0 commit comments

Comments
 (0)