question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY] How to get the raw response header Location when downloading a layer blob from ACR

See original GitHub issue

Library name and version

Azure.Containers.ContainerRegistry 1.1.0-beta.4

Query/Question

When Get Blob https://docs.microsoft.com/en-us/rest/api/containerregistry/blob/get#response returns 307 status code, is there a way to get the Location header value that was used to download the blob as part of this workflow

var repoArtifact = _registryClient.GetArtifact($"{repositoryNamespace}/{imagePath}", tag);

var manifestProperties = await repoArtifact.GetManifestPropertiesAsync();
var manifest = await blobClient.DownloadManifestAsync(new DownloadManifestOptions(digest: manifestProperties.Value.Digest));

var layer = manifest.Value.Manifest.Layers.First();

var layerResult = await blobClient.DownloadBlobAsync(layer.Digest);
var locationExists = raw.Headers.TryGetValue("Location", out var location);

Currently the headers doesn’t have Location header value.

Environment

N/A

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
sajayantonycommented, May 24, 2022

@pallavit just to give context. Teja was an architect for ACR and also helped land this SDK so it’s awesome to see feedback from a scenario from a customer perspective.

Basically I’m understanding the question as - Is there as a way to get raw response without following the 307.

Is that the ask?

1reaction
mnltejaswinicommented, May 24, 2022

@pallavit just to give context. Teja was an architect for ACR and also helped land this SDK so it’s awesome to see feedback from a scenario from a customer perspective.

Basically I’m understanding the question as - Is there as a way to get raw response without following the 307.

Is that the ask?

@sajayantony , Yep, that is the request. Would like to have the ability to send the redirect URL to downstream services(Terraform client in our case) so that they can download the content. Without the SDK support, to achieve this I have to author the blob API and implement registry auth with AAD.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blob - Get - REST API (Azure Container Registry)
Learn more about Container Registry service - Retrieve the blob from the registry identified by ... Headers. Location: string. Other Status Codes. AcrErrors....
Read more >
JavaScript/jQuery to download file via POST with JSON data
I'm trying to accomplish the following: Submit a POST that contains JSON data to a REST url. If the request specifies a JSON...
Read more >
Hunting Russian Intelligence “Snake” Malware
The communication itself is contained in the legitimate HTTP header field's value, meaning the content following the ':' character and any ...
Read more >
Repositories API | GitLab
Get the raw file contents for a blob, by blob SHA. This endpoint can be accessed without authentication if the repository is publicly...
Read more >
Apache Camel Component Reference Red Hat Fuse 7.11
Message headers set by the Azure Storage Blob Service producer consumer · 39.4.4. ... Integrate Camel into CXF transport layer" Collapse section "78.10....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found