Skip to content

jsonrpc2: fix Content-Length header parsing to be case-insensitive#789

Open
nithinputhenveettil wants to merge 1 commit intomodelcontextprotocol:mainfrom
nithinputhenveettil:fix/content-length-case-insensitive
Open

jsonrpc2: fix Content-Length header parsing to be case-insensitive#789
nithinputhenveettil wants to merge 1 commit intomodelcontextprotocol:mainfrom
nithinputhenveettil:fix/content-length-case-insensitive

Conversation

@nithinputhenveettil
Copy link

Fix Content-Length header parsing to be case-insensitive as per LSP specification.

All unit tests pass locally (go test ./...).

Fixes #787

@nithinputhenveettil
Copy link
Author

@maciej-kisiel :

Like you mentioned in the issue, I also feel a simple strings.EqualFold should do the job. All unit tests are passing successfully. I also changed Content-Length in the line below to different variations like content-length, COntent-LeNgth, etc., and in all cases the tests ran successfully.

https://github.com/modelcontextprotocol/go-sdk/blob/main/internal/jsonrpc2/frame.go#L203

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.

HeaderFramer rejects lowercase content-length header (case-insensitive per RFC)

1 participant