{"action":"opened","issue":{"url":"https://api.github.com/repos/SuaveIO/suave/issues/253","labels_url":"https://api.github.com/repos/SuaveIO/suave/issues/253/labels{/name}","comments_url":"https://api.github.com/repos/SuaveIO/suave/issues/253/comments","events_url":"https://api.github.com/repos/SuaveIO/suave/issues/253/events","html_url":"https://github.com/SuaveIO/suave/issues/253","id":78445892,"number":253,"title":"Keep-Alive causes exception in single-request case","user":{"login":"haf","id":193115,"avatar_url":"https://avatars.githubusercontent.com/u/193115?v=3","gravatar_id":"","url":"https://api.github.com/users/haf","html_url":"https://github.com/haf","followers_url":"https://api.github.com/users/haf/followers","following_url":"https://api.github.com/users/haf/following{/other_user}","gists_url":"https://api.github.com/users/haf/gists{/gist_id}","starred_url":"https://api.github.com/users/haf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haf/subscriptions","organizations_url":"https://api.github.com/users/haf/orgs","repos_url":"https://api.github.com/users/haf/repos","events_url":"https://api.github.com/users/haf/events{/privacy}","received_events_url":"https://api.github.com/users/haf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-20T09:21:39Z","updated_at":"2015-05-20T09:21:39Z","closed_at":null,"body":"If the HTTP client is something like this:\r\n\r\n``` fsharp\r\n    let req =\r\n      createRequest Post (Uri \"http://localhost:8083/filenames\")\r\n      //|> withKeepAlive false\r\n      |> withBody\r\n          (BodyForm\r\n            [  NameValue { name = \"submit-name\"; value = \"Larry\" }\r\n               MultipartMixed (\"files\",\r\n                 [ \"file1.txt\", firstCt, Plain \"Hello World\"\r\n                   \"file2.gif\", secondCt, Plain \"...contents of file2.gif...\"\r\n                 ])\r\n            ])\r\n    System.Net.ServicePointManager.Expect100Continue <- false\r\n    let response = Request.responseAsString req |> Async.RunSynchronously\r\n```\r\n\r\nThe log from the server is this:\r\n\r\n``` text\r\n[V] 2015-05-20T09:14:45.8118020Z: initialising BufferManager with 827392 bytes [Suave.Socket.BufferManager]\r\n[I] 2015-05-20T09:14:45.8464200Z: listener started in 26.875 ms with binding 127.0.0.1:8083 [Suave.Tcp.tcpIpServer]\r\n[V] 2015-05-20T09:14:45.8570580Z: 127.0.0.1 connected, total: 1 clients [Suave.Tcp.tcpIpServer.job]\r\n[V] 2015-05-20T09:14:45.8631310Z: reserving buffer: 811008, free count: 99 [Suave.Tcp.tcpIpServer.job] [Suave.Socket.BufferManager]\r\n[V] 2015-05-20T09:14:45.8684520Z: -> processor [Suave.Web.httpLoop.loop]\r\n[V] 2015-05-20T09:14:45.8797900Z: reserving buffer: 802816, free count: 98 [Suave.Web.readMoreData.loop] [Suave.Socket.BufferManager]\r\n[V] 2015-05-20T09:14:45.8910210Z: firstLine: POST /filenames HTTP/1.1 [Suave.Web.processRequest]\r\n[V] 2015-05-20T09:14:45.9181040Z: <- processor [Suave.Web.httpLoop.loop]\r\n+++++++++ inside suave +++++++++++++\r\n[V] 2015-05-20T09:14:45.9443610Z: 'Connection: keep-alive' recurse [Suave.Web.httpLoop.loop]\r\n[V] 2015-05-20T09:14:45.9444520Z: -> processor [Suave.Web.httpLoop.loop]\r\n[V] 2015-05-20T09:14:45.9462440Z: freeing buffer: 802816, free count: 99 [Suave.Web.split] [Suave.Socket.BufferManager]\r\n[V] 2015-05-20T09:14:45.9464190Z: firstLine:  [Suave.Web.processRequest]\r\n[V] 2015-05-20T09:14:45.9478450Z: tcp request processing failed [Suave.Tcp.tcpIpServer.job] exn:\r\nSystem.Exception: invalid url: ''\r\n  at Suave.Web+ParsingAndControl+processRequest@385-1.Invoke (System.Tuple`2 _arg1) [0x00000] in <filename unknown>:0\r\n  at <StartupCode$Suave>.$SocketMonad+Bind@16-1[System.Tuple`2[System.String,Suave.Sockets.Connection],Microsoft.FSharp.Core.FSharpOption`1[Suave.Types+HttpContext]].Invoke (Microsoft.FSharp.Core.FSharpChoice`2 _arg1) [0x00000] in <filename unknown>:0\r\n  at Microsoft.FSharp.Control.AsyncBuilderImpl+args@787-1[Microsoft.FSharp.Core.FSharpChoice`2[System.Tuple`2[System.String,Suave.Sockets.Connection],Suave.Sockets.Error],Microsoft.FSharp.Core.FSharpChoice`2[Microsoft.FSharp.Core.FSharpOption`1[Suave.Types+HttpContext],Suave.Sockets.Error]].Invoke (Microsoft.FSharp.Core.FSharpChoice`2 a) [0x00000] in <filename unknown>:0\r\n```\r\n\r\nThis terminates the request afaik (haven't investigated in depth) - but we should just close the socket rather than trying to parse the request and failing with `failwith`."}}