wai-middleware-static

WAI middleware that serves requests to static files.

https://github.com/scotty-web/wai-middleware-static

LTS Haskell 23.26:0.9.3@rev:1
Stackage Nightly 2025-07-04:0.9.3@rev:1
Latest on Hackage:0.9.3@rev:1

See all snapshotswai-middleware-static appears in

BSD-3-Clause licensed and maintainedbyAndrew Farmer
This version can be pinned in stack with:wai-middleware-static-0.9.3@sha256:7928b6ecc6dc03ff720d478b1eb4f58434c5dca418aa16e386593c46cc709f32,3221

Module documentation for 0.9.3

Used by 1 package inlts-23.17(full list with versions):

wai-middleware-staticBuild Status

WAI middleware that intercepts requests to static files and serves them if they exist.

Changes

0.9.3 [2024.12.28]

  • Drop support for pre-8.0 versions of GHC.

0.9.2 [2022.03.08]

  • Allow building with GHC 9.2.
  • Replace thecryptonite andmemory dependencies with equivalentfunctionality fromcryptohash-sha1 andbase16-bytestring.

0.9.1 [2021.10.31]

  • Always importData.List qualified.

0.9.0 [2020.10.01]

  • Only serve static files onHEAD orGET requests.

0.8.3 [2019.10.20]

  • AddOptions,staticWithOptions,staticPolicyWithOptions, andunsafeStaticPolicyWithOptions.
  • Parameterize Middleware with options allowing custom file name to MIME type mapping.

0.8.2 [2018.04.07]

  • Remove unused test suite.

0.8.1

  • AddSemigroup Policy instance
  • Replace dependencies onbase16-bytestring andcryptohash with the moremodernmemory andcryptonite packages, respectively [myfreeweb]

0.8.0

  • Themime-types library is now used to lookup MIME types from extensions.As a result, some extensions now map to different MIME types. They are:

    Extensionwai-middleware-staticmime-types
    classapplication/octet-streamapplication/java-vm
    dtdtext/xmlapplication/xml-dtd
    jarapplication/x-java-archiveapplication/java-archive
    jstext/javascriptapplication/javascript
    oggapplication/oggaudio/ogg
    ttfapplication/x-font-truetypeapplication/x-font-ttf
  • ExposedgetMimeType function [Shimuuar]

0.7.0.1

  • Fixed Windows build (by replacingunix dependency with equivalentdirectoryfunction)

0.7.0.0

  • Implement caching [agrafix]
  • Include mp4 and ogv mime_types [DrBoolean]
  • Dependency updates for ghc 7.10 [DougBurke]

0.6.0.1

  • Update links to new wai-middleware-static github/issue tracker.

  • Bump upper bound fortext

0.6.0

  • Update to wai 3.0

0.5.0.1

  • Bump upper bound formtl

0.5.0.0

  • AddisNotAbsolute policy and changestatic andstaticPolicy tousenoDots andisNotAbsolute policies by default. (Thanks to Nick Hibberd!)

  • AddunsafeStaticPolicy, which behaves as the old insecurestaticPolicy behaved.

  • Add changelog