forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove createDecompressor extension point in favor of attributeKey th…
…at can be populated by an extending transport Signed-off-by: Craig Perkins <[email protected]>
- Loading branch information
Showing
3 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...nsport-netty4/src/main/java/org/opensearch/http/netty4/Netty4ConditionalDecompressor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.opensearch.http.netty4; | ||
|
||
import io.netty.channel.embedded.EmbeddedChannel; | ||
import io.netty.handler.codec.http.HttpContentDecompressor; | ||
|
||
import static org.opensearch.http.netty4.Netty4HttpServerTransport.SHOULD_DECOMPRESS; | ||
|
||
public class Netty4ConditionalDecompressor extends HttpContentDecompressor { | ||
@Override | ||
protected EmbeddedChannel newContentDecoder(String contentEncoding) throws Exception { | ||
if (Boolean.FALSE.equals(ctx.channel().attr(SHOULD_DECOMPRESS).get())) { | ||
return super.newContentDecoder("identity"); | ||
} | ||
return super.newContentDecoder(contentEncoding); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters