Package io.netty.handler.codec.http.cors

Examples of io.netty.handler.codec.http.cors.CorsConfig


        assertThat(cors.allowedRequestHeaders(), hasItems("preflight-header1", "preflight-header2"));
    }

    @Test
    public void preflightResponseHeadersSingleValue() {
        final CorsConfig cors = withAnyOrigin().preflightResponseHeader("SingleValue", "value").build();
        assertThat(cors.preflightResponseHeaders().getAndConvert("SingleValue"), equalTo("value"));
    }
View Full Code Here


        assertThat(cors.preflightResponseHeaders().getAndConvert("SingleValue"), equalTo("value"));
    }

    @Test
    public void preflightResponseHeadersMultipleValues() {
        final CorsConfig cors = withAnyOrigin().preflightResponseHeader("MultipleValues", "value1", "value2").build();
        assertThat(cors.preflightResponseHeaders().getAllAndConvert("MultipleValues"), hasItems("value1", "value2"));
    }
View Full Code Here

        assertThat(cors.preflightResponseHeaders().getAllAndConvert("MultipleValues"), hasItems("value1", "value2"));
    }

    @Test
    public void defaultPreflightResponseHeaders() {
        final CorsConfig cors = withAnyOrigin().build();
        assertThat(cors.preflightResponseHeaders().get(HttpHeaderNames.DATE), is(notNullValue()));
        assertThat(cors.preflightResponseHeaders().getAndConvert(HttpHeaderNames.CONTENT_LENGTH), is("0"));
    }
View Full Code Here

        assertThat(cors.preflightResponseHeaders().getAndConvert(HttpHeaderNames.CONTENT_LENGTH), is("0"));
    }

    @Test
    public void emptyPreflightResponseHeaders() {
        final CorsConfig cors = withAnyOrigin().noPreflightResponseHeaders().build();
        assertThat(cors.preflightResponseHeaders().size(), equalTo(0));
    }
View Full Code Here

        withOrigin("*").preflightResponseHeader("HeaderName", new Object[]{null}).build();
    }

    @Test
    public void shortCurcuit() {
        final CorsConfig cors = withOrigin("http://localhost:8080").shortCurcuit().build();
        assertThat(cors.isShortCurcuit(), is(true));
    }
View Full Code Here

TOP

Related Classes of io.netty.handler.codec.http.cors.CorsConfig

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.