Example usage for io.netty.handler.codec.http2 Http2Headers addObject

List of usage examples for io.netty.handler.codec.http2 Http2Headers addObject

Introduction

In this page you can find the example usage for io.netty.handler.codec.http2 Http2Headers addObject.

Prototype

T addObject(K name, Object value);

Source Link

Document

Adds a new header.

Usage

From source file:com.linecorp.armeria.internal.ArmeriaHttpUtilTest.java

License:Apache License

@Test
public void inboundCookiesMustBeMergedForHttp2() {
    final Http2Headers in = new DefaultHttp2Headers();

    in.add(HttpHeaderNames.COOKIE, "a=b; c=d");
    in.add(HttpHeaderNames.COOKIE, "e=f;g=h");
    in.addObject(HttpHeaderNames.CONTENT_TYPE, MediaType.PLAIN_TEXT_UTF_8);
    in.add(HttpHeaderNames.COOKIE, "i=j");
    in.add(HttpHeaderNames.COOKIE, "k=l;");

    final HttpHeaders out = toArmeria(in);

    assertThat(out.getAll(HttpHeaderNames.COOKIE)).containsExactly("a=b; c=d; e=f; g=h; i=j; k=l");
}