Skip to content

Replace curl with native Go http client for proxy support and better error handling - #60

Open
dntil wants to merge 1 commit into
star-39:masterfrom
dntil:master
Open

Replace curl with native Go http client for proxy support and better error handling#60
dntil wants to merge 1 commit into
star-39:masterfrom
dntil:master

Conversation

@dntil

@dntil dntil commented Apr 16, 2026

Copy link
Copy Markdown

What this PR does

Replaced the exec.Command("curl"... ) implementation in fDownload with the already existing native Go method httpDownloadCurlUA.

Why is this needed?

  1. External OS curl ignores Docker/host HTTP_PROXY/HTTPS_PROXY configs, breaking extraction workflows when users deploy inside restricted network nodes.
  2. Failed curl commands only output a non-descriptive exit status 1 and swallow the root network cause from users.
  3. This change leverages Go native net/http to provide implicit proxy routing, proper redirection tracking, explicit granular error bubbling, and properly spoofed user-agent headers.

Tested locally via customized Docker builds. Works flawlessly around strict network firewalls!

…port and better error handling

### What this PR does
Replaced the `exec.Command("curl"... )` implementation in `fDownload` with the already existing native Go method `httpDownloadCurlUA`.

### Why is this needed?
1. External OS `curl` ignores Docker/host `HTTP_PROXY`/`HTTPS_PROXY` configs, breaking extraction workflows when users deploy inside restricted network nodes.
2. Failed curl commands only output a non-descriptive `exit status 1` and swallow the root network cause from users. 
3. This change leverages Go native `net/http` to provide implicit proxy routing, proper redirection tracking, explicit granular error bubbling, and properly spoofed user-agent headers. 

Tested locally via customized Docker builds. Works flawlessly around strict network firewalls!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant