HEAD requests return Content-Length 0 instead of actual content length #122

Closed
opened 2025-12-29 14:25:21 +01:00 by adam · 2 comments
Owner

Originally created by @alcalaperez on GitHub (Dec 1, 2025).

Hi,

I am opening an issue because I just upgraded to the latest version (v.0.20.10) and I started having issues pulling from my Docker registry. I have been testing and all seems to work on app version v.0.20.8.

On newer versions I get the following error:

docker pull registry.example.com/myapp:latest
latest: Pulling from myapp
InvalidArgument: Target.Size must be greater than zero: invalid argument

When doing the Curl call to my registry:

curl -v -I https://registry.example.com/v2/myapp/blobs/sha256:123345456712344567123475346345645
...
* Using HTTP2, server supports multiplexing
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> HEAD /v2/myapp/blobs/sha256:123345456712344567123475346345645 HTTP/2
> Host: registry.example.com
> user-agent: curl/7.81.0
> accept: */*
>
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
< HTTP/2 200
HTTP/2 200
....
content-length: 0

I did the same test using v0.20.8 and I get proper length:

content-length: 1995

My assumption is that something changed on how the content length is managed on the HEAD calls.

Originally created by @alcalaperez on GitHub (Dec 1, 2025). Hi, I am opening an issue because I just upgraded to the latest version (v.0.20.10) and I started having issues pulling from my Docker registry. I have been testing and all seems to work on app version v.0.20.8. On newer versions I get the following error: ``` docker pull registry.example.com/myapp:latest latest: Pulling from myapp InvalidArgument: Target.Size must be greater than zero: invalid argument ``` When doing the Curl call to my registry: ``` curl -v -I https://registry.example.com/v2/myapp/blobs/sha256:123345456712344567123475346345645 ... * Using HTTP2, server supports multiplexing * Connection state changed (HTTP/2 confirmed) * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * TLSv1.2 (OUT), TLS header, Supplemental data (23): > HEAD /v2/myapp/blobs/sha256:123345456712344567123475346345645 HTTP/2 > Host: registry.example.com > user-agent: curl/7.81.0 > accept: */* > * TLSv1.2 (IN), TLS header, Supplemental data (23): * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * TLSv1.2 (IN), TLS header, Supplemental data (23): * TLSv1.2 (OUT), TLS header, Supplemental data (23): * TLSv1.2 (IN), TLS header, Supplemental data (23): * TLSv1.2 (IN), TLS header, Supplemental data (23): * TLSv1.2 (IN), TLS header, Supplemental data (23): < HTTP/2 200 HTTP/2 200 .... content-length: 0 ``` I did the same test using v0.20.8 and I get proper length: `content-length: 1995` My assumption is that something changed on how the content length is managed on the HEAD calls.
adam added the bug label 2025-12-29 14:25:21 +01:00
adam closed this issue 2025-12-29 14:25:21 +01:00
Author
Owner

@yusing commented on GitHub (Dec 4, 2025):

Fixed in 0.20.11

@yusing commented on GitHub (Dec 4, 2025): Fixed in 0.20.11
Author
Owner

@alcalaperez commented on GitHub (Dec 4, 2025):

Tested with latest 0.20.12, now working as expected, many thanks for your work!

@alcalaperez commented on GitHub (Dec 4, 2025): Tested with latest 0.20.12, now working as expected, many thanks for your work!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/godoxy-yusing#122