[Bug] [BanyanDB] MCP HTTP server rejects a lowercase "bearer" Authorization scheme
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Search before asking
- I had searched in the issues and found no similar issues.
Apache SkyWalking Component
BanyanDB (apache/skywalking-banyandb)
What happened
While looking at the MCP server after #14194, I tried HTTP mode with a token and noticed that Authorization: bearer <token> (lowercase) gets a 401 even when the token is right. Only the exact Bearer prefix works, because getAuthorizationToken in mcp/src/server/http.ts uses startsWith('Bearer ').
What you expected to happen
The auth scheme name is case-insensitive (RFC 9110 section 11.1, which RFC 6750 uses for Bearer), so bearer or BEARER with the right token should be accepted. Some HTTP clients and proxies send it in lowercase, and a 401 there is confusing because the token itself is correct.
How to reproduce
On main (27349fdf), in mcp/ (BanyanDB doesn't need to be running for this):
TRANSPORT=http MCP_AUTH_TOKEN=secret MCP_PORT=3999 npx tsx src/index.ts &
curl -s -o /dev/null -w '%{http_code}\n' -X POST http://127.0.0.1:3999/mcp \
-H 'Authorization: bearer secret' -H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"ping"}'
# 401
curl -s -o /dev/null -w '%{http_code}\n' -X POST http://127.0.0.1:3999/mcp \
-H 'Authorization: Bearer secret' -H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"ping"}'
# 200
Anything else
Canopy in the same repo already handles this: bearerCredential in canopy/server/src/lib/tokens.ts matches the scheme case-insensitively. So the fix is to do the same in the MCP server, with unit tests for the header parsing. I have it ready and will link the PR here.
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Java
- Star
- 25k
- Fork
- 6.6k
- Merge trung bình
- 12 giờ 57 phút
- Pull request đã merge (30 ngày)
- 46
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/skywalking
-
[Bug] Standalone multi-group Measure aggregation returns one row per groupCó thể đã có người làm @hanahmily đã nhận 2 ngày trước. Đang mởbug database
apache/skywalking#14198 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] [BanyanDB] MCP server ignores .env values and silently accepts malformed numeric/TRANSPORT settingsCó thể đã có người làm @wanjinhao1 đã nhận 3 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
apache/skywalking#14194 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] BanyanDB trace block metadata format changed in 0.11 without a file format version bumpCó thể đã có người làm @hanahmily đã nhận 13 ngày trước. Đang mởbug database
apache/skywalking#14169 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore CLI database
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/skywalking#14168 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BanyanDB] Stream write callback reports success for events it did not storeCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/skywalking#14158 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/skywalking
Issue tương tự
-
Marketplace time-zone issueĐang mởbug main ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openhab/openhab-webui#4671 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
NearVanilla/IceCream#109 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
bancolombia/bin-stash#79 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày