Skip to content

[Bug]: GetModelArtifact returns 200 for Range requests, corrupting cached downloads (and HEAD returns 404) #119

Description

@airshiner

Summary

GET /api/haste/GetModelArtifact ignores the HTTP Range request header and returns 200 OK with the full body instead of 206 Partial Content. A client that issues a range request and treats the response as the requested byte range ends up with a corrupted assembly, and the browser caches the bad result.

Impact

The Interactive Labeler's sidecar for a ~112k-building layer is roughly 440 MB. When a range request is served as a 200, the cached artifact is poisoned and the labeler subsequently fails to initialise:

Error initializing interactive labeler

The failure persists until the browser cache is cleared, and the error message gives no hint that a cached artifact is the cause. We hit this intermittently alongside transient 5xx responses during the same large download.

Related defect on the same endpoint

HEAD on GetModelArtifact returns 404 while GET on the identical URL succeeds. That prevents clients from cheaply probing size or existence before committing to a large download.

Suggested fix

  • Honour Range and return 206 with a correct Content-Range header, or explicitly advertise Accept-Ranges: none so clients don't attempt partial fetches.
  • Make HEAD mirror GET status and headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions