diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-09 18:12:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-09 18:12:42 +0300 |
commit | e6a54b33a9712d7f1a995df47f678fbb78bcd6b7 (patch) | |
tree | cfd401dc851da9632d9be07965f209d7c5838e3f /app/services/dependency_proxy | |
parent | b808458daa86105dd2101893961338912961ee92 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/dependency_proxy')
-rw-r--r-- | app/services/dependency_proxy/head_manifest_service.rb | 5 | ||||
-rw-r--r-- | app/services/dependency_proxy/pull_manifest_service.rb | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/app/services/dependency_proxy/head_manifest_service.rb b/app/services/dependency_proxy/head_manifest_service.rb index ecc3eb77399..cd575b83a98 100644 --- a/app/services/dependency_proxy/head_manifest_service.rb +++ b/app/services/dependency_proxy/head_manifest_service.rb @@ -14,7 +14,10 @@ module DependencyProxy response = Gitlab::HTTP.head(manifest_url, headers: auth_headers.merge(Accept: ACCEPT_HEADERS)) if response.success? - success(digest: response.headers['docker-content-digest'], content_type: response.headers['content-type']) + success( + digest: response.headers[DependencyProxy::Manifest::DIGEST_HEADER], + content_type: response.headers['content-type'] + ) else error(response.body, response.code) end diff --git a/app/services/dependency_proxy/pull_manifest_service.rb b/app/services/dependency_proxy/pull_manifest_service.rb index 31494773cc0..e8f0ad6374a 100644 --- a/app/services/dependency_proxy/pull_manifest_service.rb +++ b/app/services/dependency_proxy/pull_manifest_service.rb @@ -20,7 +20,13 @@ module DependencyProxy file.write(response.body) file.flush - yield(success(file: file, digest: response.headers['docker-content-digest'], content_type: response.headers['content-type'])) + yield( + success( + file: file, + digest: response.headers[DependencyProxy::Manifest::DIGEST_HEADER], + content_type: response.headers['content-type'] + ) + ) ensure file.close file.unlink |