Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-10040

Different behavior when filter defined in undertow-handlers.conf vs via expression filter

    XMLWordPrintable

Details

    • Hide

      1. Deploy attached war.
      2. curl -v -X POST localhost:8080/files/empty — expected response code is 444, correct
      3. curl -v localhost:8080/files/empty — the expected response code is 555, but actual response code is 200 OK

      Show
      1. Deploy attached war. 2. curl -v -X POST localhost:8080/files/empty — expected response code is 444, correct 3. curl -v localhost:8080/files/empty — the expected response code is 555, but actual response code is 200 OK

    Description

      When this expression

      equals(%m, 'POST') -> { response-code(444) } else { response-code(555) }

      is put into "undertow-handlers.conf", and the predicate is false, the returned response code is 200, like the false branch was ignored.

      The handler for the false branch is set to RewriteCorrectingHandlerWrapper.

      This behavior is different when the same expression is configured via expression filter in undertow subsystem.

      Contents of files.war:

      /empty
      /not-empty
      /WEB-INF/undertow-handlers.conf
      

      Attachments

        1. files.war
          0.6 kB
          Adam Krajcik

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            akrajcik@redhat.com Adam Krajcik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: