mittwald/kubernetes-replicator

HEAD request on helm chart repo 404

sathieu opened this issue · 3 comments

Describe the bug

I'm using gitlabracadabra to sync Helm charts to an offline repo. This tool test for existence of charts by issuing an HEAD request. The server hosting the charts returns 404 for HEAD requests.

From rfc2616:

9.4 HEAD

The HEAD method is identical to GET except that the server MUST NOT
return a message-body in the response. The metainformation contained
in the HTTP headers in response to a HEAD request SHOULD be identical
to the information sent in response to a GET request. This method can
be used for obtaining metainformation about the entity implied by the
request without transferring the entity-body itself. This method is
often used for testing hypertext links for validity, accessibility,
and recent modification.

The response to a HEAD request MAY be cacheable in the sense that the
information contained in the response MAY be used to update a
previously cached entity from that resource. If the new field values
indicate that the cached entity differs from the current entity (as
would be indicated by a change in Content-Length, Content-MD5, ETag
or Last-Modified), then the cache MUST treat the cache entry as
stale.

To Reproduce

HEAD request returns 404:

$ curl --head https://helm.mittwald.de/charts/kubernetes-replicator-2.7.2.tgz -vvv
[...]
> HEAD /charts/kubernetes-replicator-2.7.2.tgz HTTP/2
> Host: helm.mittwald.de
> User-Agent: curl/7.64.0
> Accept: */*
>
[...]
< HTTP/2 404
< content-type: application/json; charset=utf-8
< date: Tue, 23 Nov 2021 08:39:49 GMT
< x-request-id: 5cd2737e-3654-44a0-ad47-569a301355c3
< content-length: 21

While GET request returns 200:

$ https_proxy=http://10.46.61.9:3128 curl  https://helm.mittwald.de/charts/kubernetes-replicator-2.7.2.tgz --output kubernetes-replicator-2.7.2.tgz -v
[...]
> GET /charts/kubernetes-replicator-2.7.2.tgz HTTP/2
> Host: helm.mittwald.de
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/2 200
< content-type: application/x-tar
< date: Tue, 23 Nov 2021 08:46:18 GMT
< x-request-id: 4b9e5e19-5a21-4940-a70d-b05390c80a04
<

Expected behavior

HEAD requests should return same HTTP status as GET request.

Environment:

  • Kubernetes version: v1.21.5
  • kubernetes-replicator version: 2.7.2

There has not been any activity to this issue in the last 14 days. It will automatically be closed after 7 more days. Remove the stale label to prevent this.

not stale.

There has not been any activity to this issue in the last 14 days. It will automatically be closed after 7 more days. Remove the stale label to prevent this.