Conditions | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | package unicon.matthews.security.auth.jwt.extractor; |
||
19 | @Override |
||
20 | public String extract(String header) { |
||
21 | if (StringUtils.isBlank(header)) { |
||
22 | throw new AuthenticationServiceException("Authorization header cannot be blank!"); |
||
23 | } |
||
24 | |||
25 | if (header.length() < HEADER_PREFIX.length()) { |
||
26 | throw new AuthenticationServiceException("Invalid authorization header size."); |
||
27 | } |
||
28 | |||
29 | return header.substring(HEADER_PREFIX.length(), header.length()); |
||
30 | } |
||
32 |
See this CWE advisory on why this is a security issue.