Skip to content

[BUG]: Download Artifact - Content Stores Differing Content-Types Cause Errors #2898

@jack0x539

Description

@jack0x539

What happened?

Afternoon!

When calling ActionsArtifactClient.DownloadArtifact, the download is often, or always, redirected to another server that holds the actual artifact.

In my experience, if the artifact happens to sit on https://pipelinesghubeus10.actions.githubusercontent.com, then the Content-Type returned is application/zip and all is well, but if the artifact happens to reside on https://productionresultssa10.blob.core.windows.net, then the Content-Type is zip and it all starts to go wrong.

There's a check in HttpClientAdapter.BuildResponse for the content type, which fails, then the response is read as a string, not a stream, and Connection.GetRawStream attempts to cast the string as a stream, understandably gets null, and returns null to the caller.

Easy to fix badly; perhaps harder to fix well.

Versions

Octokit 10.0.0

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions