on master help sign in
Version bump (fixes #506)
049a3bbMichael Snoyman
wai-extra/ChangeLog.md+4
@@ -1,3 +1,7 @@
1+## 3.0.14
2+
3+* Middleware to force domain names. [#506](https://github.com/yesodweb/wai/issues/506) [#507](https://github.com/yesodweb/wai/pull/507)
4+
1## 3.0.13.1
5## 3.0.13.1
2
6
3* Support wai 3.2
7* Support wai 3.2
wai-extra/Network/Wai/Middleware/ForceDomain.hs+5
@@ -1,3 +1,6 @@
1+-- |
2+--
3+-- @since 3.0.14
1module Network.Wai.Middleware.ForceDomain where
4module Network.Wai.Middleware.ForceDomain where
2
5
3import Data.ByteString (ByteString)
6import Data.ByteString (ByteString)
@@ -11,6 +14,8 @@ import Network.Wai.Request
11-- | Force a domain by redirecting.
14-- | Force a domain by redirecting.
12-- The `checkDomain` function takes the current domain and checks whether it is correct.
15-- The `checkDomain` function takes the current domain and checks whether it is correct.
13-- It should return `Nothing` if the domain is correct, or `Just "domain.com"` if it is incorrect.
16-- It should return `Nothing` if the domain is correct, or `Just "domain.com"` if it is incorrect.
17+--
18+-- @since 3.0.14
14forceDomain :: (ByteString -> Maybe ByteString) -> Middleware
19forceDomain :: (ByteString -> Maybe ByteString) -> Middleware
15forceDomain checkDomain app req sendResponse =
20forceDomain checkDomain app req sendResponse =
16 case requestHeaderHost req >>= checkDomain of
21 case requestHeaderHost req >>= checkDomain of
wai-extra/wai-extra.cabal+1−1
@@ -1,5 +1,5 @@
1Name: wai-extra
1Name: wai-extra
2−Version: 3.0.13.1
2+Version: 3.0.14
3Synopsis: Provides some basic WAI handlers and middleware.
3Synopsis: Provides some basic WAI handlers and middleware.
4description:
4description:
5 Provides basic WAI handler and middleware functionality:
5 Provides basic WAI handler and middleware functionality: