Skip to content

Instantly share code, notes, and snippets.

@creichert
Last active September 30, 2018 03:44
Show Gist options
  • Save creichert/eaa80fdb097ed7b08539de09952478cc to your computer and use it in GitHub Desktop.
Save creichert/eaa80fdb097ed7b08539de09952478cc to your computer and use it in GitHub Desktop.
Reproduce http-client "Invalid status line '0'"
#!/usr/bin/env stack
-- stack -v runghc --package connection --package http-client --package http-client-tls
{-# LANGUAGE OverloadedStrings #-}
import Prelude
import Control.Concurrent.Async
import Network.HTTP.Client
import Network.HTTP.Client.TLS
main :: IO ()
main = do
let (Just req) = parseUrlThrow "https://assertible.com/blog"
man <- newManager tlsManagerSettings
results <- forConcurrently [1..250] $ \_ -> do
res <- httpLbs req{method="HEAD"} man
pure (responseStatus res)
print (length results)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment