yesodweb/yesod — Issue #248: Hanging POST requests
Author: luite
Created: 2012-01-31 07:35:37+00:00
State: open

Large POST requests can cause the server to hang. Tested on OS X with the latest git version and 0.10 beta from yackage. For some reason I can't reproduce it with a simple warpDebug program, but the scaffolded site has this problem here. Can anyone reproduce this?

To reproduce:
1. yesod init, select sqlite
2. add /test TestR GET POST to the routes
3. add the handlers below to Handler/Root.hs
4. yesod devel, go in browser to /test, click button, observe that the XmlHttpRequest POST request now hangs

~~~ {.haskell}
getTestR :: Handler RepHtml
getTestR = do
defaultLayout $ do
addScriptRemote "http://code.jquery.com/jquery-1.7.1.js"
addJulius [julius|
// just a long string
d = {"contents": new Array(10000).join("a") };

testXhr = function() {
$.ajax({
url: "@{TestR}",
data: d,
success: function() { console.log("success!"); },
type: 'POST'
});
}
$(document).ready(function() {
$("#xhrbtn").on("click", testXhr);
});
|]
[whamlet|
Great success
|]
~~~