mighttpd2 2.5.3 → 2.5.4
raw patch · 4 files changed
+8/−8 lines, 4 files
Files
- FileCGIApp.hs +3/−2
- mighttpd2.cabal +1/−1
- sample.route +3/−4
- test/Test.hs +1/−1
FileCGIApp.hs view
@@ -15,11 +15,11 @@ fileCgiApp :: ClassicAppSpec -> FileAppSpec -> CgiAppSpec -> RevProxyAppSpec -> RouteDB -> Application fileCgiApp cspec filespec cgispec revproxyspec um req = case mmp of Fail -> do- let st = statusPreconditionFailed+ let st = preconditionFailed412 liftIO $ logger cspec req st Nothing fastResponse st defaultHeader "Precondition Failed\r\n" Redirect -> do- let st = statusMovedPermanently+ let st = movedPermanently301 hdr = defaultHeader ++ redirectHeader req liftIO $ logger cspec req st Nothing fastResponse st hdr "Moved Permanently\r\n"@@ -55,6 +55,7 @@ | otherwise = getRoute key ms getRoute key (m@(RouteRevProxy src _ _ _):ms) | src `isPrefixOf` key = Found m+ | src `isMountPointOf` key = Redirect | otherwise = getRoute key ms isPrefixOf :: Path -> ByteString -> Bool
mighttpd2.cabal view
@@ -1,5 +1,5 @@ Name: mighttpd2-Version: 2.5.3+Version: 2.5.4 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3
sample.route view
@@ -16,9 +16,8 @@ # Reverse proxy rules should be specified with ">>" # /path >> host:port/path2 # Either "host" or ":port" can be committed, but not both.-/app/cal >> example.net/calendar-# URLs generated by Yesod are absolute.-# We cannot re-write pathinfo.-/app/wiki >> :8080/app/wiki+/app/cal/ >> example.net/calendar/+# Yesod app in the same server+/app/wiki/ >> 127.0.0.1:8080/ / -> /export/www/
test/Test.hs view
@@ -28,6 +28,6 @@ res <- parseRoute "sample.route" res @?= ans where- ans = [Block ["localhost","www.example.com"] [RouteCGI "/~alice/cgi-bin/" "/home/alice/public_html/cgi-bin/",RouteFile "/~alice/" "/home/alice/public_html/",RouteCGI "/cgi-bin/" "/export/cgi-bin/",RouteRevProxy "/app/cal" "/calendar" "example.net" 80,RouteRevProxy "/app/wiki" "/app/wiki" "localhost" 8080,RouteFile "/" "/export/www/"]]+ ans = [Block ["localhost","www.example.com"] [RouteCGI "/~alice/cgi-bin/" "/home/alice/public_html/cgi-bin/",RouteFile "/~alice/" "/home/alice/public_html/",RouteCGI "/cgi-bin/" "/export/cgi-bin/",RouteRevProxy "/app/cal/" "/calendar/" "example.net" 80,RouteRevProxy "/app/wiki/" "/" "127.0.0.1" 8080,RouteFile "/" "/export/www/"]] ----------------------------------------------------------------