fix: enforce JSON-API headers via httpx event hook#41
Merged
sylvainkalache merged 3 commits intomainfrom Feb 6, 2026
Merged
Conversation
Change auto_promote condition from 'main' to 'master' to match the actual branch name used in Semaphore CI.
This reverts commit dbf6aa8.
Newer fastmcp versions (>=2.10) call client.send() instead of client.request(), bypassing our header override in request(). The __getattr__ delegation silently forwarded send() to the inner httpx client without applying Content-Type: application/vnd.api+json. Add an httpx event hook that enforces the correct headers at the transport level before every outgoing request, regardless of how it was initiated. Also add an explicit send() proxy and fix base_url to return the httpx URL object for newer fastmcp compatibility.
Greptile OverviewGreptile Summary
Confidence Score: 5/5
Important Files Changed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
client.send()instead ofclient.request(), bypassing our header override. The__getattr__delegation silently forwardedsend()to the inner httpx client without applyingContent-Type: application/vnd.api+json_enforce_jsonapi_headers) that enforces correct headers at the transport level before every outgoing request, regardless of how it was initiatedsend()proxy and fixesbase_urlproperty for newer fastmcp compatibilityTest plan
listTeams,getCurrentUser, and other tools no longer return 415