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

Allow directory listing to be set per-exchange in DefaultServlet and ResourceHandler

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None

      I can currently enable or disable directory listing for an entire default servlet or resource handler, but what this doesn't allow is to be able to override this on a per-request basis.  Ideally, we'd put something in the exchange (a flag or an attachment).  When null in the exchange, use the default, but when the flag in the exchange is not null, use it.

      Furthermore, add two handlers with predicate builders

      • enableDirectoryListing() - set flag in exchange to true
      • disableDirectoryListing() - set flag in exchange to false

      This would allow for a configuration such as disabling dir listing for the entire default servlet, then adding a predicate language rule like so:

      path-prefix(/downloads/) -> enableDirectoryListing()
      path-prefix(/downloads/secret/) -> disableDirectoryListing()

            rhn-cservice-bbaranow Bartosz Baranowski
            bdw429s Brad Wood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: