File and Job API: Support Range Header
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=216738) </details> <!--IssueSummary end--> ### Problem to solve When downloading large files on File and Job/Trace API, we have to download the entire file. For example, when using a python script, the whole file is in memory. To avoid this, there is an HTTP Header "Range" (bytes) which is designed to support "chunk download". Exemple ``` curl -r 0-256 -H "PRIVATE-TOKEN: $GITLAB_TOKEN" https://gitlab.com/api/v4/projects/XXXXX/jobs/YYYY/trace ``` will download first 256 octets. Like [HEAD and sha256](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/19439) it will preserve bandwith. ### Intended users Developers, SysAdmin. ### User experience goal The user should be able to partial download a file without exploding memory and escape from OOM Killer :) ### Proposal Add support to byte range header and return partial content on Files and Job traces. ### Links / references https://tools.ietf.org/html/rfc7233 https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range
issue