mirror of
https://github.com/moby/buildkit.git
synced 2026-08-09 09:11:45 +00:00
Support additional request header fields for HTTP sources, "Accept" and "User-Agent" as a start. The "Accept" header is required in some cases and some servers may vary the response body based on the header value. The "User-Agent" header may be useful in custom frontends and potentially other cases. - llb: Add `llb.Header` and `HTTPInfo.Header` to allow `client/llb` users to set these header fields on HTTP sources. The argument to `llb.Header` is a struct to effectively limit header fields to a subset. - llb: Define and flag new `source.http.header` capability when `llb.Header` is used. - solver: Define new `http.header.` source attribute prefix. Giving each header field its own attribute (opposed to JSON encoding the header struct) will allow source policy to make assertions on individual header fields. - source/http: Parse `http.header.` attributes into a sorted slice and include them in cache key digest. - source/http: Set request headers accordingly. Signed-off-by: Dan Duvall <dduvall@wikimedia.org>