diff --git a/swift/common/middleware/staticweb.py b/swift/common/middleware/staticweb.py index df52bb0ebd..7770af208f 100644 --- a/swift/common/middleware/staticweb.py +++ b/swift/common/middleware/staticweb.py @@ -59,7 +59,8 @@ requests for paths not found. For pseudo paths that have no , this middleware can serve HTML file listings if you set the ``X-Container-Meta-Web-Listings: true`` metadata item -on the container. +on the container. Note that the listing must be authorized; you may want a +container ACL like ``X-Container-Read: .r:*,.rlistings``. If listings are enabled, the listings can have a custom style sheet by setting the X-Container-Meta-Web-Listings-CSS header. For instance, setting @@ -68,6 +69,17 @@ the .../listing.css style sheet. If you "view source" in your browser on a listing page, you will see the well defined document structure that can be styled. +Additionally, prefix-based :ref:`tempurl` parameters may be used to authorize +requests instead of making the whole container publicly readable. This gives +clients dynamic discoverability of the objects available within that prefix. + +.. note:: + + ``temp_url_prefix`` values should typically end with a slash (``/``) when + used with StaticWeb. StaticWeb's redirects will not carry over any TempURL + parameters, as they likely indicate that the user created an overly-broad + TempURL. + By default, the listings will be rendered with a label of "Listing of /v1/account/container/path". This can be altered by setting a ``X-Container-Meta-Web-Listings-Label: