Skip to content

Commit bde0fae

Browse files
committed
fix(download): always send User-Agent and Accept headers
When downloading files, src.fedoraproject.org now requires the Accept header to be present. If the header is missing, it returns an HTML page instead of the requested file, causing a checksum mismatch. This change adds the "Accept: */*" and "User-Agent: BLDR/<version>" headers to all HTTP downloads to prevent this issue. This was discovered when glibc and libtirpc packages started to fail recently in the extensions repository[1]. [1] https://github.com/siderolabs/extensions/ Signed-off-by: Gilbert Gilb's <[email protected]>
1 parent fad96f3 commit bde0fae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/pkg/convert/node.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/siderolabs/bldr/internal/pkg/sbom"
2323
"github.com/siderolabs/bldr/internal/pkg/solver"
2424
"github.com/siderolabs/bldr/internal/pkg/types/v1alpha2"
25+
"github.com/siderolabs/bldr/internal/version"
2526
)
2627

2728
const (
@@ -237,6 +238,7 @@ func (node *NodeLLB) stepDownload(root llb.State, step v1alpha2.Step) llb.State
237238
for _, source := range step.Sources {
238239
download := llb.HTTP(
239240
source.URL,
241+
llb.Header(llb.HTTPHeader{Accept: "*/*", UserAgent: fmt.Sprintf("BLDR/%s", version.Tag)}),
240242
llb.Filename(filepath.Join("/", source.Destination)),
241243
llb.Checksum(digest.NewDigestFromEncoded(digest.SHA256, source.SHA256)),
242244
llb.WithCustomNamef(node.Prefix+"download %s -> %s", source.URL, source.Destination),

0 commit comments

Comments
 (0)