Skip to content

Improve detection of HTTP "Range" requests in ConcurrentDownloadImage #141

Open
@tri-adam

Description

@tri-adam

The client supports parallel downloads using HTTP Range Requests. Currently, the client assumes ranged requests are supported if and only if the server performs a redirect via a http.StatusSeeOther. Otherwise, c.singleStreamDownload is utilized:

if res.StatusCode == http.StatusOK {
// Library endpoint does not provide HTTP redirection response, treat as single stream, direct download
c.Logger.Logf("Library endpoint does not support concurrent downloads; reverting to single stream")
return c.singleStreamDownload(ctx, dst, res, pb)
}

This negatively impacts download performance against servers that support ranged requests, but do not redirect via http.StatusSeeOther, and is the root cause of #129.

The current logic should be replaced with logic that detects HTTP range support in the standard fashion (ref).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions