Provides some basic WAI handlers and middleware. http://github.com/yesodweb/wai

Version on this page:
LTS Haskell 12.22:
Stackage Nightly 2018-12-10:
Latest on Hackage:

See all snapshots wai-extra appears in

MIT licensed by Michael Snoyman
Maintained by michael@snoyman.com

Module documentation for

There are no documented modules for this package.


The goal here is to provide common features without many dependencies.

Example using Server-Sent Events

There is a small example using Server-Sent Events (SSE) in the ./example directory.

Run the commands below to start the server on http://localhost:8080

$ stack build .
$ stack exec example


Changelog for wai-extra

  • Drop unnecessary lifted-base dependency
  • Drop unnecessary stringsearch dependency #714

  • Consider quoted multipart form boundary markers #700.
  • Don’t raise exceptions in formatAsJSON #709

  • Fix a “file not found” exception in wai-extra #705

  • Add timeout middleware #702.

  • Add rewriteRoot middleware #697.

  • Drop dependency on blaze-builder, requiring streaming-commons >= 0.2

  • Support for streaming-commons 0.2
  • Support for resourcet 1.2

  • Export Network.Wai.Parse.noLimitParseRequestBodyOptions #662.

  • Revert previous change to srequest, which caused breakage

  • Set requestBodyLength for srequest #654

  • runSessionWith (runSession variant that gives access to ClientState) #629

  • All loggers follow the autoFlush setting #604


  • Add a new function basicAuth’, which passes request to the CheckCreds argument.


  • ForceSSL: preserve port number when redirecting to https. #582


  • Gzip pre compressed #580

  • Fix the way the header length is checked (for limiting the max header length)

  • Add a new function “parseRequestBodyEx” that allows various size limits to be set.

  • Allow wai-logger 2.3

  • Doc improvements

  • don’t use deprecated CRT functions on Windows #544


  • add requestSizeCheck #525

  • Add missing requestHeaderReferer and requestHeaderUserAgent fields to CGI yesod#1186

  • Case insensitive multipart request header lookup #518

  • Doc update for logStdout and logStdoutDev #515


  • Middleware to force domain names. #506 #507

  • Support wai 3.2


  • Autoflush handle #466


  • Add Network.Wai.Header.contentLength to read the Content-Length header of a response
  • The gzip middleware no longer zips responses smaller than 860 bytes


  • Add constructor for more detailed custom output formats for RequestLogger
  • Add JSON output formatter for RequestLogger


  • Adding Request Body to RequestLogger #401


  • Network.Wai.Middleware.Routed module added


  • Add appearsSecure: check if a request appears to be using SSL even in the presence of reverse proxies #362
  • Add ForceSSL middleware #363
  • Add Approot middleware

  • Test code: only include a Cookie header if there are cookies. Without this patch, yesod-test cookie handling is broken.


  • Add Cookie Handling to Network.Wai.Test #356


  • add functions to extract authentication data from Authorization header [#352](add functions to extract authentication data from Authorization header #352)

  • Access log sequence not valid #336

  • Allow fast-logger 2.3

Test suite warning cleanup

Allow blaze-builder 0.4

Fix compilation failure on Windows #321


Add the StreamFile middleware.


Add the AddHeaders middleware.

comments powered byDisqus