Skip to content

Commit 85d76ca

Browse files
committed
Set Content-Length for permanent redirection
Issuing a GET request to `/package/<name-version>.tar.gz` on hackage.haskell.org sometimes (for whatever reason) responds with an invalid header when using chunked transfer encoding. See https://discourse.haskell.org/t/hackage-errors-invalid-hash-s-5170-invalidchunkheaders/12935 Specifying a content length explicitly (hopefully) circumvents the problem.
1 parent 8815bc9 commit 85d76ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Distribution/Server/Features/LegacyRedirects.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ serveLegacyGets = msum
8282
(fileName', ".gz") -> case Posix.splitExtension fileName' of
8383
(packageStr, ".tar") -> case simpleParse packageStr of
8484
Just pkgid ->
85-
movedPermanently (packageTarball pkgid) $ toResponse ""
85+
movedPermanently (packageTarball pkgid) $ contentLength $ toResponse ()
8686
_ -> mzero
8787
_ -> mzero
8888
_ -> mzero

0 commit comments

Comments
 (0)