[jboss-jira] [JBoss JIRA] (WFLY-8641) rewrite handler produces invalid URLs when used with query part

Markus Stier (JIRA) issues at jboss.org
Wed Apr 26 04:14:00 EDT 2017


     [ https://issues.jboss.org/browse/WFLY-8641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Markus Stier updated WFLY-8641:
-------------------------------
    Steps to Reproduce: 
Undertow configuration (relevant parts only):
{code}
       <subsystem xmlns="urn:jboss:domain:undertow:3.1">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
                <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>

                <host name="default-host" alias="localhost, home">
                    <access-log pattern="Def: %h %t %v &quot;%r&quot; %s " use-server-log="true"/>
                    <filter-ref name="to-query0" predicate="regex('^/?$') and equals(%{LOCAL_SERVER_NAME}, 'home:8180')"/>
                </host>
            </server>
            <filters>
                <rewrite name="to-query0" target="/somepath?param=1234"/>
                <expression-filter name="to-query1" expression="rewrite('/somepath?param=1234')"/>
                <expression-filter name="to-query2" expression="rewrite('/somepath'); set(attribute='%{q,param}', value='1234')"/>
                <expression-filter name="to-query3" expression="rewrite('/somepath'); set(attribute='%{QUERY_STRING}', value='param=1234')"/>
                <expression-filter name="to-query4" expression="set(attribute='%{RELATIVE_PATH}', value='/somepath'); set(attribute='%{QUERY_STRING}', value='param=1234')"/>
            </filters>
        </subsystem>
{code}

Results of the different filters:
{code}
// erroneous
to-query0: /somepath?param=1234??param=1234
to-query1: /somepath?param=1234??param=1234
to-query2: /somepath
// as expected
to-query3: /somepath?param=1234
to-query4: /somepath?param=1234
{code}


  was:

Undertow configuration (relevant parts only):
{code}
       <subsystem xmlns="urn:jboss:domain:undertow:3.1">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
                <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>

                <host name="default-host" alias="localhost, documents, home, eaptest.rssystem.de">
                    <access-log pattern="Def: %h %t %v &quot;%r&quot; %s " use-server-log="true"/>
                    <filter-ref name="to-query0" predicate="regex('^/?$') and equals(%{LOCAL_SERVER_NAME}, 'home:8180')"/>
                </host>
            </server>
            <filters>
                <rewrite name="to-query0" target="/somepath?param=1234"/>
                <expression-filter name="to-query1" expression="rewrite('/somepath?param=1234')"/>
                <expression-filter name="to-query2" expression="rewrite('/somepath'); set(attribute='%{q,param}', value='1234')"/>
                <expression-filter name="to-query3" expression="rewrite('/somepath'); set(attribute='%{QUERY_STRING}', value='param=1234')"/>
                <expression-filter name="to-query4" expression="set(attribute='%{RELATIVE_PATH}', value='/somepath'); set(attribute='%{QUERY_STRING}', value='param=1234')"/>
            </filters>
        </subsystem>
{code}

Results of the different filters:
{code}
// erroneous
to-query0: /somepath?param=1234??param=1234
to-query1: /somepath?param=1234??param=1234
to-query2: /somepath
// as expected
to-query3: /somepath?param=1234
to-query4: /somepath?param=1234
{code}




> rewrite handler produces invalid URLs when used with query part
> ---------------------------------------------------------------
>
>                 Key: WFLY-8641
>                 URL: https://issues.jboss.org/browse/WFLY-8641
>             Project: WildFly
>          Issue Type: Bug
>          Components: Web (Undertow)
>    Affects Versions: 10.1.0.Final
>         Environment: * Windows 10
> * Wildfly 10.1.0 Final
>            Reporter: Markus Stier
>            Assignee: Stuart Douglas
>
> Context:
> a request of the form "http://home:8180/" should be rewritten to "http://home:8180/somepath?param=1234"
> Problem:
> The rewrite handler produces URLs which contain duplicated query parts and question marks. See excerpt from access log below.
> {code}
> [26/Apr/2017:09:26:09 +0200] home:8180 "GET /somepath?param=1234??param=1234 HTTP/1.1" 404
> {code}



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list