Project

General

Profile

Actions

Bug #7382

closed

Incorrect servlet container version detection (at least for wildfly)

Added by Henry Morgan over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
12/29/2019
Due date:
% Done:

0%

Estimated time:

Description

There's problem with servlet container version detection. ServletInit.initServletApi checks for exact match for 3, but modern app servers return 4. So JWT falls back to 2.5 servlet. Which is not right.

Take a look at line 42:

if (context.getMajorVersion() 3)
{
logger.info(\"Using servlet API 3\");
servletApi = (ServletApi)Class.forName(\"eu.webtoolkit.jwt.ServletApi3\").newInstance();
}
else
{
logger.info(\"Using servlet API 2.5\");
servletApi = (ServletApi)Class.forName(\"eu.webtoolkit.jwt.ServletApi25\").newInstance();
}
but correct way is

*if (context.getMajorVersion() >= 3)* or if *(context.getEffectiveMajorVersion() 3)*

Actions #1

Updated by Wim Dumon over 4 years ago

  • Status changed from New to Implemented @Emweb

Henry,

Thanks for reporting, I believe your analysis is accurate. I changed the code.

Best regards,

Wim.

Actions #2

Updated by Roel Standaert over 4 years ago

  • Status changed from Implemented @Emweb to Resolved
Actions #3

Updated by Roel Standaert about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF