Skip to content

fix: pass Impersonate option to extractor HTTP client#37

Merged
stefanodvx merged 1 commit intogovdbot:mainfrom
eagle1maledetto:fix/impersonate-passthrough
Mar 9, 2026
Merged

fix: pass Impersonate option to extractor HTTP client#37
stefanodvx merged 1 commit intogovdbot:mainfrom
eagle1maledetto:fix/impersonate-passthrough

Conversation

@eagle1maledetto
Copy link
Contributor

Summary

The Impersonate field from the extractor YAML configuration is not forwarded to NewHTTPClientOptions when constructing the ExtractorContext in FromURL() (internal/extractors/util.go).

This means that even when an extractor has impersonate: true set in its configuration, the HTTP client is always created with Impersonate: false. The NewChromeClient() function — which provides Chrome TLS fingerprint impersonation to bypass JA3/JA4 detection — is never invoked.

Root cause

In internal/extractors/util.go, the NewHTTPClientOptions struct is populated with all config fields (Cookies, EdgeProxy, DownloadProxy, Proxy, DisableProxy) except Impersonate. This field was likely missed when the impersonation feature was originally added in commit 3b625c8.

Fix

A single line addition that passes cfg.Impersonate through to NewHTTPClientOptions, consistent with how all other config fields are already handled:

Impersonate:   cfg.Impersonate,

Impact

  • Before: TLS impersonation was silently disabled for all extractors, regardless of configuration.
  • After: Extractors with impersonate: true in their YAML config will correctly use NewChromeClient(), which sets Chrome-like cipher suites, TLS versions, and curve preferences.

This is critical for extractors targeting services that perform TLS fingerprinting (e.g., Facebook, Instagram).

Compliance

  • Follows existing code conventions (field alignment, struct population pattern)
  • No new dependencies
  • No breaking changes — extractors without impersonate: true are unaffected
  • Commit message follows the project's Conventional Commits style (fix: ...)

The `Impersonate` field from extractor config was not being forwarded
to `NewHTTPClientOptions` when building the extractor context in
`FromURL()`. This meant that even when `impersonate: true` was set
in the extractor YAML configuration, the HTTP client would never
call `NewChromeClient()`, effectively making TLS fingerprint
impersonation a no-op for all extractors.

This one-liner adds the missing field passthrough, aligning
`Impersonate` with the other options (`Proxy`, `DisableProxy`, etc.)
that are already forwarded correctly.
@stefanodvx stefanodvx merged commit f0feb09 into govdbot:main Mar 9, 2026
3 checks passed
@eagle1maledetto eagle1maledetto deleted the fix/impersonate-passthrough branch March 10, 2026 11:59
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.

2 participants