This repository has been archived by the owner on May 15, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signal content length to upstream components when present
When the HTTP request contains `Content-Length` header, include it in the body reader passed down to upstream system components. This is to enable further optimisations during processing when the total size of a blob is known beforehand. Examples include piece selection in order to guarantee that a blob will be fully contained within a piece. With changes introduced, an upstream component may type-check for `interface { Size() int64}` and use it to then gain access to the content length. Note that based on HTTP standards, `application/octet-stream` content type is not strictly required to specify `Content-Length` header. Hence the opportunistic signalling via type-checkers.
- Loading branch information