Skip to content

fix: Remove the Authorization request header when using AI-proxy to proxy Gemini #2220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025

Conversation

hanxiantao
Copy link
Collaborator

Ⅰ. Describe what this PR did

ai-proxy 代理 gemini 时移除 Authorization 请求头

Ⅱ. Does this pull request fix one issue?

fixes #2199

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

修复前原始请求带 Authorization 请求头代理 gemini 时,报错:
image

修复后原始请求带 Authorization 请求头也能正常代理到 gemini

image

Ⅴ. Special notes for reviews

Copy link
Collaborator

@CH3CHO CH3CHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CH3CHO CH3CHO merged commit ff308d5 into alibaba:main May 13, 2025
12 checks passed
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.82%. Comparing base (ef31e09) to head (e3c68b6).
Report is 504 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2220      +/-   ##
==========================================
+ Coverage   35.91%   45.82%   +9.91%     
==========================================
  Files          69       79      +10     
  Lines       11576    12912    +1336     
==========================================
+ Hits         4157     5917    +1760     
+ Misses       7104     6649     -455     
- Partials      315      346      +31     

see 77 files with indirect coverage changes

🚀 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.

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.

[ai-proxy] 代理 Gemini 时报错认证失败
3 participants