Skip to content

Commit

Permalink
[Backport 2.11] Use new instance of Decompressor on channel initializ…
Browse files Browse the repository at this point in the history
…ation (opensearch-project#3599)

Backport 499db78 from opensearch-project#3583.

---------

Signed-off-by: Craig Perkins <craig5008@gmail.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Peter Nied <petern@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Peter Nied <petern@amazon.com>
Co-authored-by: Darshit Chanpura <dchanp@amazon.com>
  • Loading branch information
4 people committed Nov 21, 2023
1 parent 609bb2e commit 71f73d0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
public class SecurityNonSslHttpServerTransport extends Netty4HttpServerTransport {

private final ChannelInboundHandlerAdapter headerVerifier;
private final ChannelInboundHandlerAdapter conditionalDecompressor;

public SecurityNonSslHttpServerTransport(
final Settings settings,
Expand All @@ -74,7 +73,6 @@ public SecurityNonSslHttpServerTransport(
sharedGroupFactory
);
headerVerifier = new Netty4HttpRequestHeaderVerifier(restFilter, threadPool, settings);
conditionalDecompressor = new Netty4ConditionalDecompressor();
}

@Override
Expand All @@ -101,6 +99,6 @@ protected ChannelInboundHandlerAdapter createHeaderVerifier() {

@Override
protected ChannelInboundHandlerAdapter createDecompressor() {
return conditionalDecompressor;
return new Netty4ConditionalDecompressor();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.opensearch.security.ssl.http.netty;

import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.http.HttpContentDecompressor;

Expand All @@ -17,7 +16,6 @@

import org.opensearch.security.filter.NettyAttribute;

@Sharable
public class Netty4ConditionalDecompressor extends HttpContentDecompressor {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class SecuritySSLNettyHttpServerTransport extends Netty4HttpServerTranspo
private final SecurityKeyStore sks;
private final SslExceptionHandler errorHandler;
private final ChannelInboundHandlerAdapter headerVerifier;
private final ChannelInboundHandlerAdapter conditionalDecompressor;

public SecuritySSLNettyHttpServerTransport(
final Settings settings,
Expand Down Expand Up @@ -72,7 +71,6 @@ public SecuritySSLNettyHttpServerTransport(
this.sks = sks;
this.errorHandler = errorHandler;
headerVerifier = new Netty4HttpRequestHeaderVerifier(restFilter, threadPool, settings);
conditionalDecompressor = new Netty4ConditionalDecompressor();
}

@Override
Expand Down Expand Up @@ -116,6 +114,6 @@ protected ChannelInboundHandlerAdapter createHeaderVerifier() {

@Override
protected ChannelInboundHandlerAdapter createDecompressor() {
return conditionalDecompressor;
return new Netty4ConditionalDecompressor();
}
}

0 comments on commit 71f73d0

Please sign in to comment.