Skip to content

Commit

Permalink
Add Accept header to HTTP requests
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ReillyBrogan committed Dec 19, 2023
1 parent ef9d6d5 commit 1ccb605
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builder/source/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1ccb605

Please sign in to comment.