fix: allow x-ai-eg-model to be overridden via headerMutation#1977
Open
kimjihoon3106 wants to merge 1 commit into
Open
fix: allow x-ai-eg-model to be overridden via headerMutation#1977kimjihoon3106 wants to merge 1 commit into
kimjihoon3106 wants to merge 1 commit into
Conversation
The shouldIgnoreHeader function was blocking all x-ai-eg-* headers from being set or removed via the headerMutation API. This prevented users from overriding the x-ai-eg-model header to control the model name forwarded to the backend. x-ai-eg-model is a documented user-facing header (ModelNameHeaderKeyDefault) that is used in routing rules and legitimately needs to be overridable at the backend level via headerMutation. This change adds an exception for ModelNameHeaderKeyDefault in shouldIgnoreHeader, while keeping all other x-ai-eg-* internal headers protected. Fixes envoyproxy#1872
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.
Fixes #1872
Description
shouldIgnoreHeaderwas silently dropping allx-ai-eg-*headers fromheaderMutation.set, including the user-facingx-ai-eg-modelheader.This made it impossible to override the model name forwarded to the backend
via
headerMutation, even thoughx-ai-eg-modelis a documented routingheader that users are expected to control.
This commit adds an explicit exception for
ModelNameHeaderKeyDefault(
x-ai-eg-model) inshouldIgnoreHeader, allowing it to be set viaheaderMutationwhile keeping all other internalx-ai-eg-*headers protected.Related Issues/PRs (if applicable)
Fixes #1872
Special notes for reviewers (if applicable)
Only
ModelNameHeaderKeyDefault(x-ai-eg-model) is exempted from theignore list. All other
x-ai-eg-*headers remain blocked. A regressiontest and a guard test are included to cover both behaviors.