Search in sources :

Example 1 with SinglePortConfidentialityHandler

use of io.undertow.security.handlers.SinglePortConfidentialityHandler in project undertow by undertow-io.

the class SimpleConfidentialRedirectTestCase method setup.

@BeforeClass
public static void setup() throws IOException {
    DefaultServer.startSSLServer();
    HttpHandler current = new HttpHandler() {

        @Override
        public void handleRequest(final HttpServerExchange exchange) throws Exception {
            exchange.getResponseHeaders().put(HttpString.tryFromString("scheme"), exchange.getRequestScheme());
            exchange.getResponseHeaders().put(HttpString.tryFromString("uri"), exchange.getRequestURI());
            exchange.endExchange();
        }
    };
    current = new SinglePortConfidentialityHandler(current, DefaultServer.getHostSSLPort("default"));
    DefaultServer.setRootHandler(current);
}
Also used : HttpServerExchange(io.undertow.server.HttpServerExchange) HttpHandler(io.undertow.server.HttpHandler) SinglePortConfidentialityHandler(io.undertow.security.handlers.SinglePortConfidentialityHandler) BeforeClass(org.junit.BeforeClass)

Aggregations

SinglePortConfidentialityHandler (io.undertow.security.handlers.SinglePortConfidentialityHandler)1 HttpHandler (io.undertow.server.HttpHandler)1 HttpServerExchange (io.undertow.server.HttpServerExchange)1 BeforeClass (org.junit.BeforeClass)1