Example usage for io.netty.handler.codec.http HttpHeaders contains

List of usage examples for io.netty.handler.codec.http HttpHeaders contains

Introduction

In this page you can find the example usage for io.netty.handler.codec.http HttpHeaders contains.

Prototype

public boolean contains(CharSequence name, CharSequence value, boolean ignoreCase) 

Source Link

Document

Returns true if a header with the name and value exists, false otherwise.

Usage

From source file:io.gatling.http.client.ahc.util.HttpUtils.java

License:Apache License

public static boolean isConnectionClose(HttpHeaders headers) {
    return headers.contains(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE, true);
}

From source file:org.springframework.boot.web.embedded.netty.CompressionCustomizer.java

License:Apache License

private CompressionPredicate getExcludedUserAgentsPredicate(String[] excludedUserAgents) {
    if (ObjectUtils.isEmpty(excludedUserAgents)) {
        return ALWAYS_COMPRESS;
    }/*w w w. ja v a 2 s . co m*/
    return (request, response) -> {
        HttpHeaders headers = request.requestHeaders();
        return Arrays.stream(excludedUserAgents)
                .noneMatch((candidate) -> headers.contains(HttpHeaderNames.USER_AGENT, candidate, true));
    };
}