Skip to content

fix(oauth): 支持元数据端点 HEAD 请求 - #55

Merged
uvwt merged 1 commit into
mainfrom
fix/oauth-head
Sep 2, 2026
Merged

fix(oauth): 支持元数据端点 HEAD 请求#55
uvwt merged 1 commit into
mainfrom
fix/oauth-head

Conversation

@uvwt

@uvwt uvwt commented Sep 2, 2026

Copy link
Copy Markdown
Owner

修复 Issue #51 描述的 OAuth metadata HEAD 兼容问题。

变更:

  • /.well-known/oauth-authorization-server 支持 GET/HEAD
  • /.well-known/oauth-protected-resource/mcp 支持 GET/HEAD
  • HEAD 返回 200 + application/json 且无响应体
  • 非 GET/HEAD 返回 405,并设置 Allow: GET, HEAD
  • 增加 GET/HEAD/POST 回归测试

本地验证:

  • go test ./internal/httpx
  • go test ./...
  • go vet ./...
  • git diff --check
  • 临时实例实测两个 metadata 端点 GET=200、HEAD=200、POST=405

Fixes #51

@uvwt
uvwt merged commit ae7efa3 into main Sep 2, 2026
7 checks passed
@uvwt
uvwt deleted the fix/oauth-head branch September 2, 2026 09:34
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.

bug(oauth): well-known 端点拒绝 HEAD 返回 405,导致 ChatGPT 判定「does not implement OAuth」

1 participant