Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/main/java/io/supertokens/webserver/WebserverAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,6 @@ protected void service(HttpServletRequest req, HttpServletResponse resp) throws
sendTextResponse(400,
"AppId or tenantId not found => " + ((TenantOrAppNotFoundException) rootCause).getMessage(),
resp);
} else if (rootCause instanceof UnsupportedCDIVersionException) {
sendTextResponse(400, "Unsupported CDI version", resp);
} else if (rootCause instanceof BadPermissionException) {
sendTextResponse(403, rootCause.getMessage(), resp);
} else {
Expand All @@ -484,7 +482,7 @@ protected SemVer getVersionFromRequest(HttpServletRequest req) throws ServletExc
SemVer versionFromRequest = new SemVer(version);

if (versionFromRequest.greaterThan(maxCDIVersion)) {
throw new ServletException(new UnsupportedCDIVersionException());
throw new ServletException(new BadRequestException("cdi-version " + versionFromRequest + " not supported"));
}

return versionFromRequest;
Expand Down Expand Up @@ -512,12 +510,4 @@ public APIKeyUnauthorisedException() {
super();
}
}

protected static class UnsupportedCDIVersionException extends Exception {
private static final long serialVersionUID = 6058119137747009809L;

public UnsupportedCDIVersionException() {
super();
}
}
}
4 changes: 2 additions & 2 deletions src/test/java/io/supertokens/test/CDIVersionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public void testThatGreatedThanMaxCDIVersionIsNotAllowed() throws Exception {
"jwt");
fail();
} catch (HttpResponseException e) {
assert(e.getMessage().contains("Unsupported CDI version"));
assert(e.getMessage().contains("cdi-version 2.21 not supported"));
}

try {
Expand All @@ -436,7 +436,7 @@ public void testThatGreatedThanMaxCDIVersionIsNotAllowed() throws Exception {
"jwt");
fail();
} catch (HttpResponseException e) {
assert(e.getMessage().contains("Unsupported CDI version"));
assert(e.getMessage().contains("cdi-version 3.0 not supported"));
}

process.kill();
Expand Down