From 41bf66fb7672e0d534fc48de6810db0178e4dd9a Mon Sep 17 00:00:00 2001 From: Jad El-khoury <121724599+Jad-el-khoury@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:38:03 +0200 Subject: [PATCH] handling scenario when getPathInfo() returns null (#412) Handling scenario when getPathInfo() returns null --- .github/workflows/maven.yml | 2 +- .../oauth/core/utils/AbstractAdapterCredentialsFilter.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d4ab7f3ca..6a102d32c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -30,7 +30,7 @@ jobs: - jdk: '20' distribution: zulu experimental: true - - jdk: '21-ea' + - jdk: '21' distribution: zulu experimental: true continue-on-error: ${{ matrix.experimental }} diff --git a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java index b30b66b82..3b1c29483 100644 --- a/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java +++ b/server/oauth-core/src/main/java/org/eclipse/lyo/server/oauth/core/utils/AbstractAdapterCredentialsFilter.java @@ -203,10 +203,10 @@ protected String getServletUri() { * @return true - the resource is protected, otherwise false */ protected boolean isProtectedResource(HttpServletRequest request) { - return !request.getPathInfo().startsWith("/oauth"); + return (null != request.getPathInfo()) && + !request.getPathInfo().startsWith("/oauth"); } - /** * set Connector for this session *