Skip to content

Commit

Permalink
kpkg: downloader: add Accept: */* to client headers
Browse files Browse the repository at this point in the history
Some sites such as netfilter.org returns failure if the Accept header is
missing.

See http://lists.busybox.net/pipermail/busybox/2024-March/090661.html
  • Loading branch information
kreatoo committed Jun 23, 2024
1 parent 234936a commit 8db8ae5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kpkg/modules/downloader.nim
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ proc download*(url: string, file: string, instantErrorIfFail = false,
debug "downloader ran, attempting to download file from '"&url&"' to '"&file&"'"
try:
var client = newHttpClient()
client.headers = newHttpHeaders({ "Accept": "*/*" })
client.onProgressChanged = onProgressChanged
client.downloadFile(url, file&".partial")
moveFile(file&".partial", file)
Expand Down

0 comments on commit 8db8ae5

Please sign in to comment.