feat: return the vanillaFallback option as an alternative for failing requests#441
Merged
feat: return the vanillaFallback option as an alternative for failing requests#441
vanillaFallback option as an alternative for failing requests#441Conversation
There was a problem hiding this comment.
Pull request overview
This PR restores the vanilla_fallback path in impit so impersonated requests can retry with a non-fingerprinted client when connection setup fails, addressing failures like the TLS/cipher-suite incompatibility reported in #205.
Changes:
- Adds an optional
vanilla_clientalongside the existing base/H3 clients. - Refactors request sending to build a reusable
PreparedRequestand retry connect failures through the vanilla client. - Adds
ImpitError::is_connect_error()and aligns the Rust builder default forvanilla_fallbackwith the documentedfalsedefault.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
impit/src/impit.rs |
Adds vanilla fallback client construction and retry logic in the main request path. |
impit/src/errors.rs |
Adds a helper to detect connect errors for gating fallback retries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+489
to
+493
| let prepared = PreparedRequest { | ||
| method: method.clone(), | ||
| url: request.url.clone(), | ||
| headers: header_map, | ||
| body: request.body, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
vanillaFallbackoption has been noop in a few of the latest versions ofimpit. The changes from this PR return this feature to support, e.g., servers with old TLS stacks that uncover some of the emulation discrepancies and cause the requests to fail.Closes #205