diff --git a/Network/Wai/Handler/CGI.hs b/Network/Wai/Handler/CGI.hs
--- a/Network/Wai/Handler/CGI.hs
+++ b/Network/Wai/Handler/CGI.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE CPP #-}
 -- | Backend for Common Gateway Interface. Almost all users should use the
 -- 'run' function.
 module Network.Wai.Handler.CGI
@@ -109,6 +110,9 @@
                 , httpVersion = H.http11 -- FIXME
                 , requestBody = inputH contentLength
                 , vault = mempty
+#if MIN_VERSION_wai(1, 4, 0)
+                , requestBodyLength = KnownLength $ fromIntegral contentLength
+#endif
                 }
         -- FIXME worry about exception?
         res <- app env
diff --git a/wai-extra.cabal b/wai-extra.cabal
--- a/wai-extra.cabal
+++ b/wai-extra.cabal
@@ -1,5 +1,5 @@
 Name:                wai-extra
-Version:             1.3.2.3
+Version:             1.3.2.4
 Synopsis:            Provides some basic WAI handlers and middleware.
 Description:         The goal here is to provide common features without many dependencies.
 License:             MIT
@@ -22,7 +22,7 @@
 Library
   Build-Depends:     base                      >= 4 && < 5
                    , bytestring                >= 0.9.1.4
-                   , wai                       >= 1.3      && < 1.4
+                   , wai                       >= 1.3      && < 1.5
                    , old-locale                >= 1.0.0.2  && < 1.1
                    , time                      >= 1.1.4
                    , network                   >= 2.2.1.5
