Package io.netty.handler.codec.http

Examples of io.netty.handler.codec.http.DefaultHttpHeaders


        HttpHeaders headers = null;
        if (msg == null) {
            // msg may be null if a HTTP/2 frame event in received outside the HTTP message flow
            // For example a PRIORITY frame can be received in any state besides IDLE
            // and the HTTP message flow exists in OPEN.
            headers = new DefaultHttpHeaders();
            importOutOfMessageFlowHeaders(stream.id(), headers);
        } else {
            headers = getActiveHeaders(msg);
        }
        headers.set(HttpUtil.ExtensionHeaders.Names.STREAM_WEIGHT, stream.weight());
View Full Code Here


        ContainerResponse cr = mock(ContainerResponse.class);
        MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();
        when(cr.getStatusInfo()).thenReturn(mock(Response.StatusType.class));
        when(cr.getStringHeaders()).thenReturn(headers);

        DefaultHttpHeaders httpHeaders = new DefaultHttpHeaders();
        MultiMap vertxHeaders = new HeadersAdaptor(httpHeaders);
        vertxHeaders.add(HttpHeaders.CONTENT_LENGTH, "12");
        when(response.headers()).thenReturn(vertxHeaders);

        OutputStream outputStream = writer.writeResponseStatusAndHeaders(12, cr);
View Full Code Here

    server.listen(onSuccess(consumer));
  }

  private static MultiMap getHeaders(int num) {
    Map<String, String> map = genMap(num);
    MultiMap headers = new HeadersAdaptor(new DefaultHttpHeaders());
    for (Map.Entry<String, String> entry : map.entrySet()) {
      headers.add(entry.getKey(), entry.getValue());
    }
    return headers;
  }
View Full Code Here

      WebSocketVersion version =
         WebSocketVersion.valueOf((vers == null ?
           WebSocketVersion.V13 : vers).toString());
      HttpHeaders nettyHeaders;
      if (headers != null) {
        nettyHeaders = new DefaultHttpHeaders();
        for (Map.Entry<String, String> entry: headers) {
          nettyHeaders.add(entry.getKey(), entry.getValue());
        }
      } else {
        nettyHeaders = null;
View Full Code Here

  }

  @Override
  public synchronized MultiMap trailers() {
    if (trailers == null) {
      trailers = new HeadersAdaptor(new DefaultHttpHeaders());
    }
    return trailers;
  }
View Full Code Here

    public void withoutTLS() throws Exception {
        final URI uri = new URI("ws://127.0.0.1:" + port + "/simplepush/websocket");
        final EventLoopGroup group = new NioEventLoopGroup();
        try {
            final Bootstrap b = new Bootstrap();
            final HttpHeaders customHeaders = new DefaultHttpHeaders();
            final WebSocketClientHandler handler = new WebSocketClientHandler(
                            WebSocketClientHandshakerFactory.newHandshaker(
                                    uri, WebSocketVersion.V13, null, false, customHeaders));
            b.group(group)
                    .channel(NioSocketChannel.class)
View Full Code Here

    public void userAgentReaper() throws Exception {
        final URI uri = new URI("ws://127.0.0.1:" + port + "/simplepush/websocket");
        final EventLoopGroup group = new NioEventLoopGroup();
        try {
            final Bootstrap b = new Bootstrap();
            final HttpHeaders customHeaders = new DefaultHttpHeaders();
            final WebSocketClientHandler handler = new WebSocketClientHandler(
                            WebSocketClientHandshakerFactory.newHandshaker(
                                    uri, WebSocketVersion.V13, null, false, customHeaders));
            b.group(group).channel(NioSocketChannel.class).handler(new ChannelInitializer<SocketChannel>() {
                @Override
View Full Code Here

/**
* @author <a href="mailto:nmaurer@redhat.com">Norman Maurer</a>
*/
public final class CaseInsensitiveMultiMap extends HttpHeadersAdapter {
  public CaseInsensitiveMultiMap() {
    super(new DefaultHttpHeaders());
  }
View Full Code Here

  }

  @Override
  public MultiMap trailers() {
    if (trailers == null) {
      trailers = new HttpHeadersAdapter(new DefaultHttpHeaders());
    }
    return trailers;
  }
View Full Code Here

            if (headers == null) {
                return;
            }
            HttpHeaders curr = getHeaders();
            if (curr != null) {
                DefaultHttpHeaders hdrs = new DefaultHttpHeaders();
                for (Map.Entry<String, String> e : headers) {
                    hdrs.add(e.getKey(), e.getValue());
                }
                for (Map.Entry<String, String> e : curr) {
                    hdrs.add(e.getKey(), e.getValue());
                }
                this.headers.set(hdrs);
            } else {
                this.headers.set(headers);
            }
View Full Code Here

TOP

Related Classes of io.netty.handler.codec.http.DefaultHttpHeaders

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.