Last active
September 30, 2018 03:44
-
-
Save creichert/eaa80fdb097ed7b08539de09952478cc to your computer and use it in GitHub Desktop.
Reproduce http-client "Invalid status line '0'"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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