Skip to content

Commit

Permalink
Get value from transport constructor
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Oct 5, 2023
1 parent 93ca9ab commit bd96a33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
public class SecurityNonSslHttpServerTransport extends Netty4HttpServerTransport {

private SecurityRestFilter restFilter;
private final NamedXContentRegistry namedXContentRegistry;

public SecurityNonSslHttpServerTransport(
final Settings settings,
Expand All @@ -72,6 +73,7 @@ public SecurityNonSslHttpServerTransport(
tracer
);
this.restFilter = restFilter;
this.namedXContentRegistry = namedXContentRegistry;
}

@Override
Expand All @@ -93,7 +95,7 @@ protected void initChannel(Channel ch) throws Exception {

@Override
protected ChannelInboundHandlerAdapter createHeaderVerifier() {
return new Netty4HttpRequestHeaderVerifier(restFilter, xContentRegistry, threadPool, handlingSettings, settings);
return new Netty4HttpRequestHeaderVerifier(restFilter, namedXContentRegistry, threadPool, handlingSettings, settings);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class SecuritySSLNettyHttpServerTransport extends Netty4HttpServerTranspo
private final SecurityKeyStore sks;
private final SslExceptionHandler errorHandler;
private final SecurityRestFilter restFilter;
private final NamedXContentRegistry namedXContentRegistry;

public SecuritySSLNettyHttpServerTransport(
final Settings settings,
Expand Down Expand Up @@ -78,6 +79,7 @@ public SecuritySSLNettyHttpServerTransport(
this.sks = sks;
this.errorHandler = errorHandler;
this.restFilter = restFilter;
this.namedXContentRegistry = namedXContentRegistry;
}

@Override
Expand Down Expand Up @@ -157,7 +159,7 @@ protected void configurePipeline(Channel ch) {

@Override
protected ChannelInboundHandlerAdapter createHeaderVerifier() {
return new Netty4HttpRequestHeaderVerifier(restFilter, xContentRegistry, threadPool, handlingSettings, settings);
return new Netty4HttpRequestHeaderVerifier(restFilter, namedXContentRegistry, threadPool, handlingSettings, settings);
}

@Override
Expand Down

0 comments on commit bd96a33

Please sign in to comment.