From de3fbdf2e6eab69801a8e0c42de5eb2be0faca02 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 4 May 2020 13:00:35 +0200 Subject: [PATCH] oci authenticator: Accept the right docker manifest when authenticating Without this I got for the fedora registry: ``` getting token for https://registry.fedoraproject.org/v2/f32/flatpak-runtime/manifests/sha256:bd83b4f6974094848efac22b933419c1dbe11b553def148a82f821faf595de8a F: Anonymous authentication failed: Unexpected response status 404 from repo ``` (cherry picked from commit 1ee132e70e5d0cb5fa0e022c2271f76bcfd03054) --- common/flatpak-oci-registry.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/flatpak-oci-registry.c b/common/flatpak-oci-registry.c index 2505771e..ae363bc1 100644 --- a/common/flatpak-oci-registry.c +++ b/common/flatpak-oci-registry.c @@ -1015,6 +1015,9 @@ flatpak_oci_registry_get_token (FlatpakOciRegistry *self, msg = soup_message_new_from_uri ("HEAD", uri); + soup_message_headers_replace (msg->request_headers, "Accept", + FLATPAK_OCI_MEDIA_TYPE_IMAGE_MANIFEST ", " FLATPAK_DOCKER_MEDIA_TYPE_IMAGE_MANIFEST2); + stream = soup_session_send (self->soup_session, msg, NULL, error); if (stream == NULL) return NULL;