Skip to content

fix: set SchemeHeaderTransformation.MatchUpstream on AI Gateway listeners - #2194

Merged
nacx merged 3 commits into
envoyproxy:mainfrom
kanurag94:azure-stream-fix
Jun 10, 2026
Merged

fix: set SchemeHeaderTransformation.MatchUpstream on AI Gateway listeners#2194
nacx merged 3 commits into
envoyproxy:mainfrom
kanurag94:azure-stream-fix

Conversation

@kanurag94

Copy link
Copy Markdown
Member

Description

Azure is strict about scheme header to be same as the TLS transport on which the request is being made. If the listener is an http listener, envoy forwards a request with scheme: http instead of https. This leads to requests getting dropped.
The simple solution is to use matchUpstream which is what is being done in MCP backend listeners but missed in regular AI gateway route listeners.

Related Issues/PRs (if applicable)
Fixes #2095

…ners

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
@kanurag94
kanurag94 requested a review from a team as a code owner June 4, 2026 06:45
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 4, 2026
@nacx
nacx enabled auto-merge (squash) June 10, 2026 09:58
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.69%. Comparing base (1db3a15) to head (0b5fa23).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2194      +/-   ##
==========================================
+ Coverage   84.50%   84.69%   +0.19%     
==========================================
  Files         144      144              
  Lines       21055    21057       +2     
==========================================
+ Hits        17792    17835      +43     
+ Misses       2188     2143      -45     
- Partials     1075     1079       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nacx

nacx commented Jun 10, 2026

Copy link
Copy Markdown
Member

/retest

@nacx
nacx merged commit 41b839d into envoyproxy:main Jun 10, 2026
54 of 57 checks passed
hustxiayang pushed a commit to hustxiayang/ai-gateway that referenced this pull request Jun 12, 2026
…ners (envoyproxy#2194)

**Description**

Azure is strict about `scheme` header to be same as the TLS transport on
which the request is being made. If the listener is an http listener,
envoy forwards a request with `scheme: http` instead of `https`. This
leads to requests getting dropped.
The simple solution is to use `matchUpstream` which is what is being
done in MCP backend listeners but missed in regular AI gateway route
listeners.

**Related Issues/PRs (if applicable)**
Fixes envoyproxy#2095

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: yxia216 <yxia216@bloomberg.net>
hustxiayang pushed a commit to hustxiayang/ai-gateway that referenced this pull request Jun 16, 2026
…ners (envoyproxy#2194)

**Description**

Azure is strict about `scheme` header to be same as the TLS transport on
which the request is being made. If the listener is an http listener,
envoy forwards a request with `scheme: http` instead of `https`. This
leads to requests getting dropped.
The simple solution is to use `matchUpstream` which is what is being
done in MCP backend listeners but missed in regular AI gateway route
listeners.

**Related Issues/PRs (if applicable)**
Fixes envoyproxy#2095

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: yxia216 <yxia216@bloomberg.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure OpenAI returns RST_STREAM when Envoy uses HTTP/2

3 participants