/** * <p>Convenience method for checking whether or not a named header contains a specific value, regardless of case. * If the named header is not set, or if the given value is not contained within that header's value list, this * method returns <em>false</em>.</p> * * <p><em>NOTE:</em> This method is case-INSENSITIVE.</p> * * @param key The key whose values to search in. * @param value The values to search for, ignoring case. * @return True if the given value was found in the named header. * @see #contains */ public boolean containsIgnoreCase(String key, String value) { return h.containsIgnoreCase(key, value); }
/** * Returns whether this request was <em>explicitly</em> chunked from the client. NOTE that there are cases * where the underlying HTTP server library (Netty for the time being) will read the request in a chunked manner. An * application MUST wait for {@link com.yahoo.jdisc.handler.ContentChannel#close(com.yahoo.jdisc.handler.CompletionHandler)} * before it can actually know that it has received the entire request. * * @return true if this request was chunked from the client. */ public boolean isChunked() { return version == Version.HTTP_1_1 && headers().containsIgnoreCase(HttpHeaders.Names.TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED); }
public boolean isKeepAlive() { if (headers().containsIgnoreCase(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.KEEP_ALIVE)) { return true; } if (headers().containsIgnoreCase(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.CLOSE)) { return false; } return version == Version.HTTP_1_1; }