Home / Function/ preflightGetRequestWithCustomHeaders() — netty Function Reference

preflightGetRequestWithCustomHeaders() — netty Function Reference

Architecture documentation for the preflightGetRequestWithCustomHeaders() function in CorsHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5213db82_0515_537c_923b_5c45eeeb002a["preflightGetRequestWithCustomHeaders()"]
  e946b2e4_b243_053e_5c0a_3d1a9a50042d["CorsHandlerTest"]
  5213db82_0515_537c_923b_5c45eeeb002a -->|defined in| e946b2e4_b243_053e_5c0a_3d1a9a50042d
  style 5213db82_0515_537c_923b_5c45eeeb002a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/cors/CorsHandlerTest.java lines 135–149

    @Test
    public void preflightGetRequestWithCustomHeaders() {
        final CorsConfig config = forOrigin("http://localhost:8888")
                .allowedRequestMethods(OPTIONS, GET, DELETE)
                .allowedRequestHeaders("content-type", "xheader1")
                .build();
        final HttpResponse response = preflightRequest(config, "http://localhost:8888", "content-type, xheader1");
        assertEquals("http://localhost:8888", response.headers().get(ACCESS_CONTROL_ALLOW_ORIGIN));
        assertThat(response.headers().get(ACCESS_CONTROL_ALLOW_METHODS)).contains("OPTIONS");
        assertThat(response.headers().get(ACCESS_CONTROL_ALLOW_METHODS)).contains("GET");
        assertThat(response.headers().get(ACCESS_CONTROL_ALLOW_HEADERS)).contains("content-type");
        assertThat(response.headers().get(ACCESS_CONTROL_ALLOW_HEADERS)).contains("xheader1");
        assertEquals(ORIGIN.toString(), response.headers().get(VARY));
        assertTrue(ReferenceCountUtil.release(response));
    }

Domain

Subdomains

Frequently Asked Questions

What does preflightGetRequestWithCustomHeaders() do?
preflightGetRequestWithCustomHeaders() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/cors/CorsHandlerTest.java.
Where is preflightGetRequestWithCustomHeaders() defined?
preflightGetRequestWithCustomHeaders() is defined in codec-http/src/test/java/io/netty/handler/codec/http/cors/CorsHandlerTest.java at line 135.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free