From 1ccb605e486b457846c86bcce5e9da4c011f56da Mon Sep 17 00:00:00 2001 From: Reilly Brogan Date: Mon, 18 Dec 2023 21:34:37 -0600 Subject: [PATCH] Add Accept header to HTTP requests While debugging why netfilter.org was returning a 403 with the Solbuild client I noticed that wget (which succeeded) was sending the `Accept: */*` header. When I added it to Solbuild it started working. This header should be safe to send in all circumstances as it merely indicates that we're willing to accept any content-type (which we are). Signed-off-by: Reilly Brogan --- builder/source/simple.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builder/source/simple.go b/builder/source/simple.go index 993fb08..f940109 100644 --- a/builder/source/simple.go +++ b/builder/source/simple.go @@ -128,6 +128,9 @@ func (s *SimpleSource) download(destination string) error { return err } + // Indicate that we will accept any response content-type. Some servers will fail without this (like netfilter.org) + req.HTTPRequest.Header.Add("Accept", `*/*`) + // Ensure the checksum matches if !s.legacy { sum, err := hex.DecodeString(s.validator)