public boolean applyDecoding(HttpHeader httpPacket) { final HttpResponsePacket httpResponse = (HttpResponsePacket) httpPacket; final DataChunk bc = httpResponse.getHeaders().getValue(Header.ContentEncoding); return bc != null && bc.indexOf("gzip", 0) != -1; }
/** * check if we need to wrap the PayloadGenerator with ExpectHandler */ private PayloadGenerator wrapWithExpectHandlerIfNeeded(final PayloadGenerator payloadGenerator, final HttpRequestPacket requestPacket) { if (payloadGenerator == null) { return null; } // check if we need to wrap the PayloadGenerator with ExpectWrapper final MimeHeaders headers = requestPacket.getHeaders(); final int expectHeaderIdx = headers.indexOf(Header.Expect, 0); return expectHeaderIdx != -1 && headers.getValue(expectHeaderIdx).equalsIgnoreCase("100-Continue") ? PayloadGenFactory.wrapWithExpect(payloadGenerator) : payloadGenerator; }
@Override public FluentCaseInsensitiveStringsMap getHeaders() { if (!initialized) { synchronized (headers) { if (!initialized) { initialized = true; final MimeHeaders headersLocal = response.getHeaders(); for (int i = 0; i < headersLocal.size(); i++) { headers.add(headersLocal.getName(i).toString(Charsets.ASCII_CHARSET), headersLocal.getValue(i).toString(Charsets.ASCII_CHARSET)); } } } } return headers; }
/** * @return <code>true</code> if a content type has been set. */ public boolean isContentTypeSet() { return contentType.isMimeTypeSet() || headers.getValue(Header.ContentType) != null; }
/** * @return <code>true</code> if a content type has been set. */ public boolean isContentTypeSet() { return contentType.isMimeTypeSet() || headers.getValue(Header.ContentType) != null; }
/** * @return <code>true</code> if a content type has been set. */ public boolean isContentTypeSet() { return contentType.isMimeTypeSet() || headers.getValue(Header.ContentType) != null; }
protected SettingsFrame getHttp2UpgradeSettings( final HttpRequestPacket httpRequest) { final DataChunk http2Settings = httpRequest.getHeaders().getValue(Header.HTTP2Settings); return http2Settings != null ? SettingsFrame.fromBase64Uri(http2Settings) : null; }
/** * Reads the header value using UTF-8 encoding */ private String readHeader(MimeHeaders headers, final String name) { final DataChunk value = headers.getValue(name); return value == null || value.isNull() ? null : value.toString(); }
public boolean applyDecoding(HttpHeader httpPacket) { final HttpResponsePacket httpResponse = (HttpResponsePacket) httpPacket; final DataChunk bc = httpResponse.getHeaders().getValue(Header.ContentEncoding); return bc != null && bc.indexOf("gzip", 0) != -1; }
protected void findNext() { next = null; for (; pos < size; pos++) { final DataChunk n1 = headers.getName(pos); if (n1.equalsIgnoreCase(name)) { next = headers.getValue(pos); break; } } pos++; }
/** * Obtain content-encoding value and mark it as serialized. * * @param value container for the content-type value. */ protected void extractContentEncoding(final DataChunk value) { final int idx = headers.indexOf(Header.ContentEncoding, 0); if (idx != -1) { headers.setSerialized(idx, true); value.set(headers.getValue(idx)); } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }
private void parseContentTypeHeader() { contentTypeParsed = true; if (!contentType.isSet()) { final DataChunk dc = headers.getValue(Header.ContentType); if (dc != null && !dc.isNull()) { setContentType(dc.toString()); } } }