diff --git a/servius.cabal b/servius.cabal
--- a/servius.cabal
+++ b/servius.cabal
@@ -1,5 +1,5 @@
 Name:                servius
-Version:             1.1.0.2
+Version:             1.1.1
 Synopsis:            Serve Shakespearean templates via Warp
 Homepage:            http://github.com/yesodweb/hamlet
 License:             MIT
@@ -15,9 +15,9 @@
 Executable servius
   Main-is:       servius.hs
   Build-depends: base            >= 4                  && < 5
-               , warp            >= 1.3                && < 1.4
-               , wai-app-static  >= 1.3                && < 1.4
-               , wai-extra       >= 1.3                && < 1.4
+               , warp            >= 1.3                && < 2.1
+               , wai-app-static  >= 1.3                && < 2.1
+               , wai-extra       >= 1.3                && < 2.1
                , cmdargs         >= 0.6.7
                , directory       >= 1.0
                , containers      >= 0.2
@@ -29,7 +29,7 @@
                , hamlet          >= 1.1                && < 1.2
                , shakespeare-css >= 1.0                && < 1.1
                , transformers
-               , wai             >= 1.3                && < 1.5
+               , wai             >= 1.3                && < 2.1
                , mime-types      >= 0.1                && < 0.2
 
 source-repository head
diff --git a/servius.hs b/servius.hs
--- a/servius.hs
+++ b/servius.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE DeriveDataTypeable, RecordWildCards #-}
 {-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE CPP #-}
 import Network.Wai.Application.Static (staticApp, defaultFileServerSettings)
 import Network.Wai.Handler.Warp (run)
 import System.Console.CmdArgs hiding (def)
@@ -83,6 +84,10 @@
     bs <- S8.readFile $ T.unpack fp
     let t = decodeUtf8With lenientDecode bs
     return $ T.unpack t
+
+#if MIN_VERSION_wai(2, 0, 0)
+#define ResponseBuilder responseBuilder
+#endif
 
 hamlet :: Text -> IO Response
 hamlet fp = do
