Fix case-sensitive Accept header comparison
## Motivation and Context RFC 9110 defines media type comparison as case-insensitive, but `parse_accept_header` compared types without normalizing case. This caused `Application/JSON` or `TEXT/Event-Stream` to be rejected with 406 Not Acceptable. ## How Has This Been Tested? Added tests for mixed-case Accept headers: - `Accept: Application/JSON, Text/Event-Stream` succeeds for POST - `Accept: TEXT/EVENT-STREAM` succeeds for GET SSE ## Breaking Changes None. This is a bug fix bringing behavior into conformance with RFC 9110.
This commit is contained in:
parent
d17cc51c20
commit
9b89620257
1 changed files with 40 additions and 1 deletions
|
|
@ -504,7 +504,7 @@ module MCP
|
|||
|
||||
def parse_accept_header(header)
|
||||
header.split(",").map do |part|
|
||||
part.split(";").first.strip
|
||||
part.split(";").first.strip.downcase
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue