Skip to content

Commit

Permalink
Merge branch 'main' into fix-public-record-npe
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro authored Nov 5, 2024
2 parents 62cd783 + 690a53a commit 938a0c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.67.9 - 2024-11-05

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.67.8...v2.67.9)

## v2.67.8 - 2024-11-04

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.67.7...v2.67.8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,19 @@ protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServl
throws ServletException, IOException {
LOG.trace("ApiRateLimitFilter starts, rate limit is : " + enableRateLimiting);
if (enableRateLimiting) {
String tokenValue = httpServletRequest.getHeader("Authorization").replaceAll("Bearer|bearer", "").trim();

String tokenValue = null;
if (httpServletRequest.getHeader("Authorization") != null) {
tokenValue = httpServletRequest.getHeader("Authorization").replaceAll("Bearer|bearer", "").trim();
}
String ipAddress = httpServletRequest.getRemoteAddr();

String clientId = null;
try {
clientId = orcidTokenStore.readClientId(tokenValue);
} catch (Exception ex) {
LOG.error("Exception when trying to get the client id from token value, ignoring and treating as anonymous client", ex);
if (tokenValue != null) {
try {
clientId = orcidTokenStore.readClientId(tokenValue);
} catch (Exception ex) {
LOG.error("Exception when trying to get the client id from token value, ignoring and treating as anonymous client", ex);
}
}
boolean isAnonymous = (clientId == null);
LocalDate today = LocalDate.now();
Expand Down

0 comments on commit 938a0c5

Please sign in to comment.