Package io.netty.handler.codec.http

Examples of io.netty.handler.codec.http.FullHttpRequest.refCnt()


                .preflightResponseHeader("CustomHeader", Arrays.asList("value1", "value2"))
                .build();
        final EmbeddedChannel channel = new EmbeddedChannel(new CorsHandler(config));
        final FullHttpRequest request = optionsRequest("http://localhost:8888", "content-type, xheader1");
        channel.writeInbound(request);
        assertThat(request.refCnt(), is(0));
    }

    @Test
    public void forbiddenShouldReleaseRequest() {
        final CorsConfig config = CorsConfig.withOrigin("https://localhost").shortCurcuit().build();
View Full Code Here


        final CorsConfig config = CorsConfig.withOrigin("https://localhost").shortCurcuit().build();
        final EmbeddedChannel channel = new EmbeddedChannel(new CorsHandler(config), new EchoHandler());
        final FullHttpRequest request = createHttpRequest(GET);
        request.headers().set(ORIGIN, "http://localhost:8888");
        channel.writeInbound(request);
        assertThat(request.refCnt(), is(0));
    }

    private static HttpResponse simpleRequest(final CorsConfig config, final String origin) {
        return simpleRequest(config, origin, null);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.