-
Notifications
You must be signed in to change notification settings - Fork 256
Description
HTTP File download is skipped when headResp.ContentLength returns 0
when we access our private terraform module registry hosted on a gitlab deployment behind an entra application proxy the header response returns a contentlength of 0 and than we get an empty archive file (tgz) with terraform that is using go-getter to download the terraform modules.
and get the error from terraform/go-getter:
Error opening a gzip reader for C:\...\..\AppData\Local\Temp\getter1099997155\archive: EOF
like mentioned here #537
After investigation we see that the entra application proxy returns a content length of 0 and when doing it from our on prem environment without the proxy in between we do get a content length greater than zero and the file got correctly downloaded
looks like the azure application proxy is setting the content length to 0
its fixed for us when changing the contentlenght condition to > 0
Line 446 in 3713030
if headResp.Header.Get("Accept-Ranges") == "bytes" && headResp.ContentLength >= 0 { |
like this
if headResp.Header.Get("Accept-Ranges") == "bytes" && headResp.ContentLength > 0 {