Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

No body for HEAD requests (thanks Gregory Collins)

  • Loading branch information...
commit 0671ec5e0ce9edb5a4ad3ba7b02d086fa90d3fd9 1 parent 897dbb4
Michael Snoyman authored
Showing with 5 additions and 3 deletions.
  1. +4 −2 Network/HTTP/Enumerator.hs
  2. +1 −1  http-enumerator.cabal
6 Network/HTTP/Enumerator.hs
View
@@ -89,7 +89,7 @@ import qualified Data.ByteString.Char8 as S8
import Data.Enumerator
( Iteratee (..), Stream (..), catchError, throwError, consume
, yield, Step (..), Enumeratee, ($$), joinI, Enumerator, run
- , continue, enumList, returnI
+ , continue, enumList, returnI, enumEOF
)
import qualified Data.Enumerator as E
import Network.HTTP.Enumerator.HttpParser
@@ -286,7 +286,9 @@ http bodyIter Request {..} = do
if ("content-encoding", "gzip") `elem` hs'
then joinI $ ungzip $$ x
else x
- body' $ decompress $ bodyIter sc hs
+ if method == "HEAD"
+ then enumEOF $$ bodyIter sc hs
+ else body' $ decompress $ bodyIter sc hs
chunkedEnumeratee :: MonadIO m => Enumeratee S.ByteString S.ByteString m a
chunkedEnumeratee k@(Continue _) = do
2  http-enumerator.cabal
View
@@ -1,5 +1,5 @@
name: http-enumerator
-version: 0.2.1.3
+version: 0.2.1.4
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
Please sign in to comment.
Something went wrong with that request. Please try again.