-
Notifications
You must be signed in to change notification settings - Fork 57
fix(interpolation): return empty string for unresolved variables#107
Open
diegoQuinas wants to merge 1 commit into
Open
fix(interpolation): return empty string for unresolved variables #107diegoQuinas wants to merge 1 commit into
diegoQuinas wants to merge 1 commit into
Conversation
When a variable referenced in request headers (e.g. {{X_STG_TOKEN}})
is not defined in the current environment, interpolate() now returns
an empty string instead of leaving the raw {{var}} template literal.
Headers with empty values are then filtered out before the request is
sent, preventing server-side rejection due to unresolved variables.
Also improves error_classifier to walk the source chain of reqwest
builder errors, so the actual cause (e.g. "invalid header value") is
visible in error messages.
@diegoQuinas
diegoQuinas
force-pushed
the
fix/unresolved-vars-empty-string
branch
from
June 9, 2026 20:47
f2c89d1 to
8fbc517
Compare
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.
Description
When a variable referenced in request headers is not defined in the current environment,
interpolate()now returns an empty string instead of leaving the raw{{var}}template literal. Headers with empty values are then filtered out before the request is sent.This prevents server-side rejection when switching between environments that have different variable sets defined.
Changes
apps/desktop/src-tauri/src/http/interpolation.rs""for unresolved vars (was{{var}}literal). Updated testtest_unresolved_left_as_is→test_unresolved_returns_empty. Addedtest_mixed_known_and_unknown.apps/cli/src/interpolation.rsapps/desktop/src-tauri/src/http/request_builder.rsbuild_requestand AWSv4 auth flows.apps/desktop/src-tauri/src/http/error_classifier.rsapps/desktop/src-tauri/tests/integration_tests.rstest_empty_header_filteredintegration test.Test Plan
cargo test— 65 unit + 69 integration tests pass, 0 failurestest_unresolved_preservednow asserts""instead of{{unknown}}test_mixed_varsupdated to expect empty string for unresolved portiontest_empty_header_filteredverifies empty-value headers are excluded but non-empty headers remainBreaking Changes
None. The behavior change is backward compatible — variables that exist still resolve normally. The only difference is that unresolved
{{var}}references no longer produce invalid header values.Closes #106