Example usage for io.netty.util AsciiString contentEqualsIgnoreCase

List of usage examples for io.netty.util AsciiString contentEqualsIgnoreCase

Introduction

In this page you can find the example usage for io.netty.util AsciiString contentEqualsIgnoreCase.

Prototype

public boolean contentEqualsIgnoreCase(CharSequence string) 

Source Link

Document

Compares the specified string to this string ignoring the case of the characters and returns true if they are equal.

Usage

From source file:com.linecorp.armeria.internal.http.ArmeriaHttpUtil.java

License:Apache License

public static void toArmeria(io.netty.handler.codec.http.HttpHeaders inHeaders, HttpHeaders out) {
    final Iterator<Entry<CharSequence, CharSequence>> i = inHeaders.iteratorCharSequence();
    while (i.hasNext()) {
        final Entry<CharSequence, CharSequence> entry = i.next();
        final AsciiString aName = AsciiString.of(entry.getKey()).toLowerCase();
        if (!HTTP_TO_HTTP2_HEADER_BLACKLIST.contains(aName)) {
            // https://tools.ietf.org/html/rfc7540#section-8.1.2.2 makes a special exception for TE
            if (aName.contentEqualsIgnoreCase(HttpHeaderNames.TE)
                    && !AsciiString.contentEqualsIgnoreCase(entry.getValue(), HttpHeaderValues.TRAILERS)) {
                continue;
            }//from  w  w  w .  j  a  va  2  s.  c o m

            out.add(aName, entry.getValue().toString());
        }
    }
}