[Bug] [BanyanDB] MCP HTTP server rejects a lowercase "bearer" Authorization scheme
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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
- 主要语言
- Java
- 星标
- 25k
- 派生
- 6.6k
- 平均合并
- 12 小时 57 分钟
- 30 天内合并 PR
- 46
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/skywalking 的其他 Issue
-
[Bug] Standalone multi-group Measure aggregation returns one row per group可能已有人在做 @hanahmily 于 3 天前认领。 未关闭bug database
apache/skywalking#14198 · 已指派 2 人 ·
维护者通常 1 天内回复
-
[Bug] [BanyanDB] MCP server ignores .env values and silently accepts malformed numeric/TRANSPORT settings可能已有人在做 @wanjinhao1 于 4 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 35/100
apache/skywalking#14194 ·
维护者通常 1 天内回复
-
[Bug] BanyanDB trace block metadata format changed in 0.11 without a file format version bump可能已有人在做 @hanahmily 于 13 天前认领。 未关闭bug database
apache/skywalking#14169 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
chore CLI database
难度 5/5 一周以上 新手友好度 25/100
apache/skywalking#14168 · 2 条评论 ·
维护者通常 1 天内回复
-
[BanyanDB] Stream write callback reports success for events it did not store可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
apache/skywalking#14158 · 2 条评论 ·
维护者通常 1 天内回复
查看 apache/skywalking 的全部 Issue
相似的 Issue
-
Type: Possible bug
难度 2/5 1-3 小时 新手友好度 84/100
AntennaPod/AntennaPod#8895 ·
维护者通常 1 天内回复
-
bug build failed
难度 1/5 1 小时以内 新手友好度 91/100
objectionary/eo#9852 · 1 条评论 ·
维护者通常 2 天内回复
-
dependencies enhancement
难度 2/5 1-3 小时 新手友好度 76/100
BrendonButler/Shops#79 ·
维护者通常 1 天内回复
-
finsim-core good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
Require-Capability osgi.ee still says JavaSE 1.8 but classes are compiled for Java 11可能已有人在做 @arturobernalg 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
eclipse-ee4j/angus-mail#232 ·
维护者通常 3 天内回复