From 36f6bb7ad699708844fa8333d6404d80bb03852b Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Mon, 16 Oct 2023 10:11:54 -0400 Subject: [PATCH] Move var Signed-off-by: Craig Perkins --- .../ssl/http/netty/Netty4HttpRequestHeaderVerifier.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/opensearch/security/ssl/http/netty/Netty4HttpRequestHeaderVerifier.java b/src/main/java/org/opensearch/security/ssl/http/netty/Netty4HttpRequestHeaderVerifier.java index f666c77771..51825e977b 100644 --- a/src/main/java/org/opensearch/security/ssl/http/netty/Netty4HttpRequestHeaderVerifier.java +++ b/src/main/java/org/opensearch/security/ssl/http/netty/Netty4HttpRequestHeaderVerifier.java @@ -81,8 +81,6 @@ public void channelRead0(ChannelHandlerContext ctx, DefaultHttpRequest msg) thro try (ThreadContext.StoredContext ignore = threadPool.getThreadContext().stashContext()) { injectUser(msg, threadContext); - boolean shouldSkipAuthentication = SecurityRestUtils.shouldSkipAuthentication(requestChannel); - // If request channel is completed and a response is sent, then there was a failure during authentication restFilter.checkAndAuthenticateRequest(requestChannel); @@ -91,6 +89,7 @@ public void channelRead0(ChannelHandlerContext ctx, DefaultHttpRequest msg) thro requestChannel.getQueuedResponse().ifPresent(response -> ctx.channel().attr(EARLY_RESPONSE).set(response)); + boolean shouldSkipAuthentication = SecurityRestUtils.shouldSkipAuthentication(requestChannel); boolean shouldDecompress = !shouldSkipAuthentication && requestChannel.getQueuedResponse().isEmpty(); if (requestChannel.getQueuedResponse().isEmpty() || shouldSkipAuthentication) {