public class BrAwareServerResponseCaptureFilter
extends net.lightbody.bmp.filters.ServerResponseCaptureFilter
ServerResponseCaptureFilter
but adds support for br encoding to the existing gz support.| Modifier and Type | Class and Description |
|---|---|
protected static interface |
BrAwareServerResponseCaptureFilter.DecompressionFilter |
| Modifier and Type | Field and Description |
|---|---|
static String |
HEADER_VALUE_BROTLI_ENCODING |
| Constructor and Description |
|---|
BrAwareServerResponseCaptureFilter(io.netty.handler.codec.http.HttpRequest originalRequest,
boolean decompressEncodedContent) |
BrAwareServerResponseCaptureFilter(io.netty.handler.codec.http.HttpRequest originalRequest,
io.netty.channel.ChannelHandlerContext ctx,
boolean decompressEncodedContent) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
captureContentEncoding(io.netty.handler.codec.http.HttpResponse httpResponse) |
protected void |
captureFullResponseContents() |
protected void |
captureTrailingHeaders(io.netty.handler.codec.http.LastHttpContent lastContent) |
protected BrAwareServerResponseCaptureFilter.DecompressionFilter |
createDecompressor(List<String> contentEncodings) |
protected BrAwareServerResponseCaptureFilter.DecompressionFilter |
createDecompressor(String singleEncoding) |
protected void |
decompressContents() |
protected byte[] |
decompressContents(byte[] compressedBytes,
BrAwareServerResponseCaptureFilter.DecompressionFilter decompressor) |
protected Stream<String> |
explodeContentEncoding(String value)
Explodes a content-encoding value into one or more individual token values.
|
String |
getContentEncoding() |
byte[] |
getFullResponseContents()
Returns the contents of the entire response.
|
io.netty.handler.codec.http.HttpResponse |
getHttpResponse() |
byte[] |
getRawResponseContents()
Returns the raw contents of the entire response, without decompression.
|
io.netty.handler.codec.http.HttpHeaders |
getTrailingHeaders() |
boolean |
isDecompressionSuccessful() |
boolean |
isResponseCompressed() |
protected String |
mergeEncodings(Iterable<String> contentEncodings) |
io.netty.handler.codec.http.HttpObject |
serverToProxyResponse(io.netty.handler.codec.http.HttpObject httpObject) |
protected void |
storeResponseContent(io.netty.handler.codec.http.HttpContent httpContent) |
clientToProxyRequest, proxyToClientResponse, proxyToServerConnectionFailed, proxyToServerConnectionQueued, proxyToServerConnectionSSLHandshakeStarted, proxyToServerConnectionStarted, proxyToServerConnectionSucceeded, proxyToServerRequest, proxyToServerRequestSending, proxyToServerRequestSent, proxyToServerResolutionFailed, proxyToServerResolutionStarted, proxyToServerResolutionSucceeded, serverToProxyResponseReceived, serverToProxyResponseReceiving, serverToProxyResponseTimedOutpublic static final String HEADER_VALUE_BROTLI_ENCODING
public BrAwareServerResponseCaptureFilter(io.netty.handler.codec.http.HttpRequest originalRequest,
boolean decompressEncodedContent)
public BrAwareServerResponseCaptureFilter(io.netty.handler.codec.http.HttpRequest originalRequest,
io.netty.channel.ChannelHandlerContext ctx,
boolean decompressEncodedContent)
public io.netty.handler.codec.http.HttpObject serverToProxyResponse(io.netty.handler.codec.http.HttpObject httpObject)
serverToProxyResponse in interface org.littleshoot.proxy.HttpFiltersserverToProxyResponse in class net.lightbody.bmp.filters.ServerResponseCaptureFilterprotected void captureFullResponseContents()
captureFullResponseContents in class net.lightbody.bmp.filters.ServerResponseCaptureFilterprotected byte[] decompressContents(byte[] compressedBytes,
BrAwareServerResponseCaptureFilter.DecompressionFilter decompressor)
throws IOException
IOExceptionprotected Stream<String> explodeContentEncoding(String value)
gzip,br is broken into a list [gzip, br].value - the content-encoding header valueprotected BrAwareServerResponseCaptureFilter.DecompressionFilter createDecompressor(String singleEncoding) throws com.github.mike10004.seleniumhelp.BrAwareServerResponseCaptureFilter.UnsupportedContentEncodingException
com.github.mike10004.seleniumhelp.BrAwareServerResponseCaptureFilter.UnsupportedContentEncodingExceptionprotected BrAwareServerResponseCaptureFilter.DecompressionFilter createDecompressor(List<String> contentEncodings) throws com.github.mike10004.seleniumhelp.BrAwareServerResponseCaptureFilter.UnsupportedContentEncodingException
com.github.mike10004.seleniumhelp.BrAwareServerResponseCaptureFilter.UnsupportedContentEncodingExceptionprotected void decompressContents()
decompressContents in class net.lightbody.bmp.filters.ServerResponseCaptureFilterprotected void captureContentEncoding(io.netty.handler.codec.http.HttpResponse httpResponse)
captureContentEncoding in class net.lightbody.bmp.filters.ServerResponseCaptureFilterprotected void captureTrailingHeaders(io.netty.handler.codec.http.LastHttpContent lastContent)
captureTrailingHeaders in class net.lightbody.bmp.filters.ServerResponseCaptureFilterprotected void storeResponseContent(io.netty.handler.codec.http.HttpContent httpContent)
storeResponseContent in class net.lightbody.bmp.filters.ServerResponseCaptureFilterpublic io.netty.handler.codec.http.HttpResponse getHttpResponse()
getHttpResponse in class net.lightbody.bmp.filters.ServerResponseCaptureFilterpublic byte[] getFullResponseContents()
decompressEncodedContent is true, and
decompression was successful, this method returns the decompressed contents.getFullResponseContents in class net.lightbody.bmp.filters.ServerResponseCaptureFilterpublic byte[] getRawResponseContents()
getRawResponseContents in class net.lightbody.bmp.filters.ServerResponseCaptureFilterpublic io.netty.handler.codec.http.HttpHeaders getTrailingHeaders()
getTrailingHeaders in class net.lightbody.bmp.filters.ServerResponseCaptureFilterpublic boolean isResponseCompressed()
isResponseCompressed in class net.lightbody.bmp.filters.ServerResponseCaptureFilterpublic boolean isDecompressionSuccessful()
isDecompressionSuccessful in class net.lightbody.bmp.filters.ServerResponseCaptureFilterpublic String getContentEncoding()
getContentEncoding in class net.lightbody.bmp.filters.ServerResponseCaptureFilterCopyright © 2016–2018. All rights reserved.