summaryrefslogtreecommitdiff
path: root/Utility/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-09 14:57:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-09 14:57:48 -0400
commitc9f27fb9a94cdf526d823542ccb82be5217bee63 (patch)
treea064aa5c75dd86622e9930c94bfa71f2fd585279 /Utility/WebApp.hs
parent07ca31c4725e1b62863ec93a6d03f2e13c41b3fa (diff)
webapp: Work around bug in Warp's slowloris attack prevention code, that caused regular browsers to stall when they reuse a connection after leaving it idle for 30 seconds. (See https://github.com/yesodweb/wai/issues/146)
Diffstat (limited to 'Utility/WebApp.hs')
-rw-r--r--Utility/WebApp.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs
index c6aae9db5..0623d4a48 100644
--- a/Utility/WebApp.hs
+++ b/Utility/WebApp.hs
@@ -56,9 +56,14 @@ browserCommand = "xdg-open"
runWebApp :: Wai.Application -> (SockAddr -> IO ()) -> IO ()
runWebApp app observer = do
sock <- localSocket
- void $ forkIO $ runSettingsSocket defaultSettings sock app
+ void $ forkIO $ runSettingsSocket webAppSettings sock app
observer =<< getSocketName sock
+webAppSettings = defaultSettings
+ -- disable buggy sloworis attack prevention code
+ { settingsTimeout = 30 * 60
+ }
+
{- Binds to a local socket, selecting any free port.
-
- Prefers to bind to the ipv4 address rather than the ipv6 address