Package io.netty.handler.codec.http

Examples of io.netty.handler.codec.http.HttpResponse.status()


    @Test
    public void simpleRequestNoShortCurcuit() {
        final CorsConfig config = CorsConfig.withOrigin("http://localhost:8080").build();
        final HttpResponse response = simpleRequest(config, "http://localhost:7777");
        assertThat(response.status(), is(OK));
        assertThat(response.headers().get(ACCESS_CONTROL_ALLOW_ORIGIN), is(nullValue()));
    }

    @Test
    public void shortCurcuitNonCorsRequest() {
View Full Code Here


    @Test
    public void shortCurcuitNonCorsRequest() {
        final CorsConfig config = CorsConfig.withOrigin("https://localhost").shortCurcuit().build();
        final HttpResponse response = simpleRequest(config, null);
        assertThat(response.status(), is(OK));
        assertThat(response.headers().get(ACCESS_CONTROL_ALLOW_ORIGIN), is(nullValue()));
    }

    @Test
    public void preflightRequestShouldReleaseRequest() {
View Full Code Here

            frameHeaders.set(PATH, httpRequest.uri());
            frameHeaders.setObject(VERSION, httpMessage.protocolVersion());
        }
        if (httpMessage instanceof HttpResponse) {
            HttpResponse httpResponse = (HttpResponse) httpMessage;
            frameHeaders.setInt(STATUS, httpResponse.status().code());
            frameHeaders.set(PATH, URL);
            frameHeaders.setObject(VERSION, httpMessage.protocolVersion());
            spdySynStreamFrame.setUnidirectional(true);
        }
View Full Code Here

    @Override
    public void messageReceived(ChannelHandlerContext ctx, HttpObject msg) {
        if (msg instanceof HttpResponse) {
            HttpResponse response = (HttpResponse) msg;

            System.out.println("STATUS: " + response.status());
            System.out.println("VERSION: " + response.protocolVersion());
            System.out.println();

            if (!response.headers().isEmpty()) {
                for (CharSequence name : response.headers().names()) {
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.