Skip to content

The dotnet-install scripts don't handle proxy-injected redirect responses #650

@baronfel

Description

@baronfel

See actions/setup-dotnet#650 for full context, content taken from #649.

The dotnet install scripts previously assumed every non-final HTTP status in the aka.ms redirect chain must be 301. Some proxies inject additional HTTP response blocks, such as "200 Connection Established", which caused valid redirect chains to be treated as broken.

As an example:

HTTP/1.1 301 Moved Permanently
Server: Kestrel
Location: https://aka.ms/dotnet/8.0/dotnet-sdk-linux-x64.tar.gz

HTTP/1.1 301 Moved Permanently
Server: Kestrel
Location: https://builds.dotnet.microsoft.com/dotnet/Sdk/8.0.411/dotnet-sdk-8.0.411-linux-x64.tar.gz

HTTP/1.1 200 Connection Established
Proxy-Agent: Zscaler/6.2

HTTP/1.1 200 OK
Content-Type: application/octet-stream
...
Content-Length: 216078119
Akamai-GRN: 0.e31e1602.1751887072.96833289

The current logic drops the final response code (presumably a 2xx/4xx/5xx), and then checks the remaining codes for anything that is not 301, assuming that indicates failure. However, in the above example there would still be a 200 at the end, resulting in an assumed redirect failure despite this actually being a success.

(@kalined I made this from your content because we like to have issues for tracking purposes - thank you for your PR!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: httpIssues related to incorrect handling of HTTP requests or responses

    Type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions