on master help sign in
Merge remote-tracking branch 'origin/master'
5eef19dMichael Snoyman
imagesdeleted−1
@@ -1 +0,0 @@
1−wai-app-static/images
test/adeleted−1
@@ -1 +0,0 @@
1−../wai-app-static/test/a
test/main.hsdeleted−8
@@ -1,8 +0,0 @@
1−import qualified WaiAppStaticTest
2−import qualified WaiExtraTest
3−import Test.Hspec.Monadic
4−
5−main :: IO a
6−main = hspecX $ do
7− WaiAppStaticTest.specs
8− WaiExtraTest.specs
test/requestsdeleted−1
@@ -1 +0,0 @@
1−../wai-extra/test/requests
test/testdeleted−1
@@ -1 +0,0 @@
1−../wai-app-static/test
test/wai-app-staticdeleted−1
@@ -1 +0,0 @@
1−../wai-app-static/test
test/wai-extradeleted−1
@@ -1 +0,0 @@
1−../wai-extra/test
wai-extra/Network/Wai/Middleware/RequestLogger.hs+2
@@ -47,6 +47,7 @@ logHandle cb app req = do
47 , " "
47 , " "
48 , "Accept: "
48 , "Accept: "
49 , maybe "" toBS $ lookup "Accept" $ requestHeaders req
49 , maybe "" toBS $ lookup "Accept" $ requestHeaders req
50+ , "\n"
50 ]
51 ]
51 app req
52 app req
52
53
@@ -85,6 +86,7 @@ logHandleDev cb app req = do
85 , maybe "" id $ lookup "Accept" $ requestHeaders req
86 , maybe "" id $ lookup "Accept" $ requestHeaders req
86 , paramsToBS "GET " getParams
87 , paramsToBS "GET " getParams
87 , paramsToBS "POST " postParams
88 , paramsToBS "POST " postParams
89+ , "\n"
88 ]
90 ]
89 -- we just consumed the body- fill the enumerator back up so it is available again
91 -- we just consumed the body- fill the enumerator back up so it is available again
90 body' <- C.bufferSource $ CL.sourceList body
92 body' <- C.bufferSource $ CL.sourceList body
wai-handler-launch/Network/Wai/Handler/Launch.hs+11−7
@@ -4,6 +4,7 @@
4module Network.Wai.Handler.Launch
4module Network.Wai.Handler.Launch
5 ( run
5 ( run
6 , runUrl
6 , runUrl
7+ , runUrlPort
7 ) where
8 ) where
8
9
9import Network.Wai
10import Network.Wai
@@ -105,32 +106,35 @@ foreign import ccall "launch"
105 launch' :: Int -> CString -> IO ()
106 launch' :: Int -> CString -> IO ()
106#endif
107#endif
107
108
108−launch :: String -> IO ()
109+launch :: Int -> String -> IO ()
109
110
110#if WINDOWS
111#if WINDOWS
111−launch s = withCString s $ launch' 4587
112+launch port s = withCString s $ launch' port
112#else
113#else
113−launch s = forkIO (rawSystem
114+launch port s = forkIO (rawSystem
114#if MAC
115#if MAC
115 "open"
116 "open"
116#else
117#else
117 "xdg-open"
118 "xdg-open"
118#endif
119#endif
119− ["http://127.0.0.1:4587/" ++ s] >> return ()) >> return ()
120+ ["http://127.0.0.1:" ++ show port ++ "/" ++ s] >> return ()) >> return ()
120#endif
121#endif
121
122
122run :: Application -> IO ()
123run :: Application -> IO ()
123run = runUrl ""
124run = runUrl ""
124
125
125runUrl :: String -> Application -> IO ()
126runUrl :: String -> Application -> IO ()
127+runUrl = runUrlPort 4587
128+
129+runUrlPort :: Int -> String -> Application -> IO ()
126−runUrl url app = do
130+runUrlPort port url app = do
127 x <- newIORef True
131 x <- newIORef True
128 _ <- forkIO $ Warp.runSettings Warp.defaultSettings
132 _ <- forkIO $ Warp.runSettings Warp.defaultSettings
129− { Warp.settingsPort = 4587
133+ { Warp.settingsPort = port
130 , Warp.settingsOnException = const $ return ()
134 , Warp.settingsOnException = const $ return ()
131 , Warp.settingsHost = "127.0.0.1"
135 , Warp.settingsHost = "127.0.0.1"
132 } $ ping x app
136 } $ ping x app
133− launch url
137+ launch port url
134 loop x
138 loop x
135
139
136loop :: IORef Bool -> IO ()
140loop :: IORef Bool -> IO ()
wai-handler-launch/wai-handler-launch.cabal−1
@@ -1,4 +1,3 @@
1−Name: wai-handler-launch
2Version: 1.0.0
1Version: 1.0.0
3Synopsis: Launch a web app in the default browser.
2Synopsis: Launch a web app in the default browser.
4Description: This handles cross-platform launching and inserts Javascript code to ping the server. When the server no longer receives pings, it shuts down.
3Description: This handles cross-platform launching and inserts Javascript code to ping the server. When the server no longer receives pings, it shuts down.
wai-mega.cabaldeleted−171
@@ -1,171 +0,0 @@
1−Name: wai-mega
2−Version: 0.4.2
3−Synopsis: WAI mega install
4−Description: Provides a common protocol for communication between web applications and web servers.
5−License: BSD3
6−License-file: LICENSE
7−Author: Michael Snoyman
8−Maintainer: michael@snoyman.com
9−Homepage: https://github.com/yesodweb/wai
10−Category: Web
11−Build-Type: Simple
12−Cabal-Version: >= 1.8
13−Stability: Stable
14−
15−Source-repository head
16− type: git
17− location: git://github.com/yesodweb/wai.git
18−
19−Library
20− cpp-options: -DMEGA
21− hs-source-dirs:
22− wai
23− wai-app-static
24− wai-eventsource
25− wai-extra
26− wai-handler-devel
27− wai-handler-fastcgi
28− wai-handler-launch
29− wai-handler-scgi
30− wai-handler-webkit
31− wai-test
32− wai-websockets
33− warp
34− warp-static
35−
36− Build-Depends: base >= 4 && < 5
37−
38− -- wai-handler-scgi
39− -- wai-handler-launch
40− , process >= 1.0 && < 1.2
41− -- warp-static
42−
43− -- warp
44− , simple-sendfile >= 0.1 && < 0.2
45−
46− -- wai-websockets
47− , network-enumerator >= 0.1.2 && < 0.2
48− , websockets >= 0.4 && < 0.5
49−
50− -- wai-test
51− , cookie >= 0.2 && < 0.4
52− , HUnit >= 1.2 && < 1.3
53− , case-insensitive >= 0.2 && < 0.4
54−
55− -- wai-handler-devel
56− , hint >= 0.3.2.3 && < 0.4
57− , text >= 0.7 && < 0.12
58− , old-time >= 1.0 && < 1.1
59− , attoparsec >= 0.10
60−
61− -- wai-extra
62− , wai >= 0.4 && < 0.5
63− , old-locale >= 1.0 && < 1.1
64− , network >= 2.2.1.5 && < 2.4
65− , directory >= 1.0.1 && < 1.2
66− , zlib-bindings >= 0.0 && < 0.1
67− , blaze-builder-enumerator >= 0.2 && < 0.3
68− , case-insensitive >= 0.2 && < 0.4
69− , zlib-enum >= 0.2.1 && < 0.3
70− , data-default >= 0.3 && < 0.4
71−
72− -- wai-app-static
73− , bytestring >= 0.9.1.4 && < 0.10
74− , http-types >= 0.6 && < 0.7
75− , transformers >= 0.2.2 && < 0.3
76− , unix-compat >= 0.2 && < 0.3
77− , containers >= 0.2 && < 0.5
78− , blaze-html >= 0.4 && < 0.5
79− , time >= 1.1.4 && < 1.4
80− , old-locale >= 1.0.0.2 && < 1.1
81− , file-embed >= 0.0.3.1 && < 0.1
82− , blaze-builder >= 0.2.1.4 && < 0.4
83− , base64-bytestring >= 0.1 && < 0.2
84− , cryptohash >= 0.7 && < 0.8
85− , http-date
86−
87− -- wai
88− , enumerator >= 0.4.8 && < 0.5
89− , http-types >= 0.6 && < 0.7
90− , text >= 0.5 && < 1.0
91−
92− Exposed-modules:
93− -- warp-static
94−
95− -- warp
96− Network.Wai.Handler.Warp
97−
98− -- wai-websockets
99− Network.Wai.Handler.WebSockets
100−
101− -- wai-test
102− Network.Wai.Test
103−
104− -- wai-handler-webkit
105− Network.Wai.Handler.Webkit
106−
107− -- wai-handler-scgi
108− Network.Wai.Handler.SCGI
109−
110− -- wai-handler-launch
111− Network.Wai.Handler.Launch
112−
113− -- wai-handler-fastcghi
114− Network.Wai.Handler.FastCGI
115−
116− -- wai-app-static
117− Network.Wai.Application.Static
118−
119− --wai
120− Network.Wai
121−
122− -- wai-handler-devel
123− Network.Wai.Handler.DevelServer
124− Network.Wai.Application.Devel
125−
126− -- wai-extra
127− Network.Wai.Handler.CGI
128− Network.Wai.Middleware.AcceptOverride
129− Network.Wai.Middleware.Autohead
130− Network.Wai.Middleware.CleanPath
131− Network.Wai.Middleware.Debug
132− Network.Wai.Middleware.Gzip
133− Network.Wai.Middleware.Jsonp
134− Network.Wai.Middleware.MethodOverride
135− Network.Wai.Middleware.Rewrite
136− Network.Wai.Middleware.Vhost
137− Network.Wai.Zlib
138− Network.Wai.Parse
139−
140− ghc-options: -Wall
141−
142−test-suite test
143− hs-source-dirs:
144− test
145− test/wai-app-static
146− test/wai-extra
147−
148− main-is: main.hs
149− type: exitcode-stdio-1.0
150−
151− build-depends: base >= 4 && < 5
152− , wai-mega
153− , hspec >= 0.8 && < 0.10
154− , HUnit
155− , unix-compat >= 0.2 && < 0.3
156− , time >= 1.1.4 && < 1.4
157− , old-locale >= 1.0.0.2 && < 1.1
158− , http-date
159− , http-types
160− , network
161− , bytestring
162− , text
163− , transformers
164− , enumerator
165− , zlib
166− , directory
167− , zlib-bindings
168− , blaze-builder-enumerator >= 0.2 && < 0.3
169− , blaze-builder >= 0.2.1.4 && < 0.4
170− , zlib-enum
171− , data-default