Examples of ProxyHttpServletRequestWrapper


Examples of org.apache.chemistry.opencmis.server.filter.ProxyHttpServletRequestWrapper

    @Test
    public void testGetProxiedProtoBaseAddress() throws URISyntaxException {
        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_PROTO_HEADER)).thenReturn(
                FORWARDED_HTTPS_PROTO);

        ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, null);

        assertEquals(FORWARDED_HTTPS_PROTO, proxyRequest.getScheme());

        URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());

        assertEquals(FORWARDED_HTTPS_PROTO, baseUri.getScheme());
        assertEquals(BACKEND_SERVER_NAME, baseUri.getHost());
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.filter.ProxyHttpServletRequestWrapper

        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_PROTO_HEADER)).thenReturn(
                FORWARDED_HTTPS_PROTO);
        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_HOST_HEADER)).thenReturn(
                FORWARDED_SERVER_NAME);

        ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, null);

        assertEquals(FORWARDED_HTTPS_PROTO, proxyRequest.getScheme());
        assertEquals(FORWARDED_SERVER_NAME, proxyRequest.getServerName());

        URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());

        assertEquals(FORWARDED_HTTPS_PROTO, baseUri.getScheme());
        assertEquals(FORWARDED_SERVER_NAME, baseUri.getHost());
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.filter.ProxyHttpServletRequestWrapper

    @Test
    public void testGetProxiedHostBaseAddress() throws URISyntaxException {
        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_HOST_HEADER)).thenReturn(
                FORWARDED_SERVER_NAME);

        ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, null);

        assertEquals(FORWARDED_SERVER_NAME, proxyRequest.getServerName());

        URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());

        assertEquals(BACKEND_SERVER_PROTO, baseUri.getScheme());
        assertEquals(FORWARDED_SERVER_NAME, baseUri.getHost());
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.filter.ProxyHttpServletRequestWrapper

        String path = "/test";

        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_HOST_HEADER)).thenReturn(
                FORWARDED_SERVER_NAME);

        ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, path);

        assertEquals(FORWARDED_SERVER_NAME, proxyRequest.getServerName());

        URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());

        assertEquals(BACKEND_SERVER_PROTO, baseUri.getScheme());
        assertEquals(FORWARDED_SERVER_NAME, baseUri.getHost());
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.filter.ProxyHttpServletRequestWrapper

    @Test
    public void testGetProxiedHostAndPortBaseAddress() throws URISyntaxException {
        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_HOST_HEADER)).thenReturn(FORWARDED_HOST);

        ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, null);

        assertTrue(FORWARDED_HOST.startsWith(proxyRequest.getServerName()));

        URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());

        assertEquals(BACKEND_SERVER_PROTO, baseUri.getScheme());
        assertEquals(FORWARDED_SERVER_NAME, baseUri.getHost());
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.filter.ProxyHttpServletRequestWrapper

    public void testGetProxiedHostPortAndProtoBaseAddress() throws URISyntaxException {
        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_PROTO_HEADER)).thenReturn(
                FORWARDED_HTTPS_PROTO);
        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_HOST_HEADER)).thenReturn(FORWARDED_HOST);

        ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, null);

        assertEquals(FORWARDED_HTTPS_PROTO, proxyRequest.getScheme());
        assertTrue(FORWARDED_HOST.startsWith(proxyRequest.getServerName()));

        URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());

        assertEquals(FORWARDED_HTTPS_PROTO, baseUri.getScheme());
        assertEquals(FORWARDED_SERVER_NAME, baseUri.getHost());
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.filter.ProxyHttpServletRequestWrapper

        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_PROTO_HEADER)).thenReturn(
                FORWARDED_HTTP_PROTO);
        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_HOST_HEADER)).thenReturn(
                FORWARDED_SERVER_NAME + ":noportnumber");

        ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, null);

        assertEquals(FORWARDED_HTTP_PROTO, proxyRequest.getScheme());
        assertTrue(FORWARDED_HOST.startsWith(proxyRequest.getServerName()));

        URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());

        assertEquals(FORWARDED_HTTP_PROTO, baseUri.getScheme());
        assertEquals(FORWARDED_SERVER_NAME, baseUri.getHost());
View Full Code Here

Examples of org.apache.chemistry.opencmis.server.filter.ProxyHttpServletRequestWrapper

        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_PROTO_HEADER)).thenReturn(
                FORWARDED_HTTPS_PROTO);
        when(this.request.getHeader(ProxyHttpServletRequestWrapper.FORWARDED_HOST_HEADER)).thenReturn(
                FORWARDED_SERVER_NAME + ":noportnumber");

        ProxyHttpServletRequestWrapper proxyRequest = new ProxyHttpServletRequestWrapper(request, null);

        assertEquals(FORWARDED_HTTPS_PROTO, proxyRequest.getScheme());
        assertTrue(FORWARDED_HOST.startsWith(proxyRequest.getServerName()));

        URI baseUri = new URI(AtomPubUtils.compileBaseUrl(proxyRequest, REPOSITORY_ID).toString());

        assertEquals(FORWARDED_HTTPS_PROTO, baseUri.getScheme());
        assertEquals(FORWARDED_SERVER_NAME, baseUri.getHost());
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.