Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-510

Unlike JBossWeb, Undertow treats virtual host aliases case-sensitively

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.3.0.Beta7
    • 1.3.0.Beta4
    • Core
    • None
    • Hide

      Use upper case characters in alias names for Wildfly server virtual hosts.

      Show
      Use upper case characters in alias names for Wildfly server virtual hosts.
    • Hide

      Don't use any upper case characters in alias names for Wildfly server virtual hosts.

      Show
      Don't use any upper case characters in alias names for Wildfly server virtual hosts.

      Problem

      Undertow treats domain x alias matching case-sensitively. I believe it directly violates the contract of IETF RFC 1035.

      For instance, if one configures these two test applications simplecontext-examples.zip as root content for their respective aliases:

      <subsystem xmlns="urn:jboss:domain:undertow:3.0" instance-id="workerXXX">
          <buffer-cache name="default"/>
          <server name="default-server">
              <ajp-listener name="ajp" socket-binding="ajp"/>
              <http-listener name="default" redirect-socket="https" socket-binding="http"/>
              <host name="default-host" alias="localhost">
                  <location name="/" handler="welcome-content"/>
                  <filter-ref name="server-header"/>
                  <filter-ref name="x-powered-by-header"/>
              </host>
              <host name="web1" alias="web1.rhel7GAx86-64">
                  <location name="/" handler="web1-content"/>
                  <filter-ref name="server-header"/>
                  <filter-ref name="x-powered-by-header"/>
              </host>
              <host name="web2" alias="web2.rhel7GAx86-64">
                  <location name="/" handler="web2-content"/>
                  <filter-ref name="server-header"/>
                  <filter-ref name="x-powered-by-header"/>
              </host>
          </server>
          <servlet-container name="default">
              <jsp-config/>
              <websockets/>
          </servlet-container>
          <handlers>
              <file name="web1-content" path="${jboss.home.dir}/simplecontext-web1"/>
              <file name="web2-content" path="${jboss.home.dir}/simplecontext-web2"/>
              <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
          </handlers>
          <filters>
              <response-header name="server-header" header-value="WildFly/10" header-name="Server"/>
              <response-header name="x-powered-by-header" header-value="Undertow/1" header-name="X-Powered-By"/>
          </filters>
      </subsystem>

      , only requests exactly matching the alias land in the web application context, the rest of them goes straight to the WildFly welcome page, which is wrong:

        Undertow JBossWeb
      curl web1.rhel7GAx86-64:8080/
      curl web1.rhel7Gax86-64:8080/
      curl web1.rhel7gax86-64:8080/
      curl web1:8080/
      curl WEB1:8080/

      Call to action

      Could you evaluate this report and comment on whether the case sensitive matching is indeed intentional or not?

            sdouglas1@redhat.com Stuart Douglas
            mbabacek1@redhat.com Michal Karm
            Michal Karm Michal Karm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: