List of usage examples for io.netty.handler.codec.http HttpHeaders contains
public boolean contains(CharSequence name, CharSequence value, boolean ignoreCase)
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)); }; }