Skip to content

Fix telescope response middleware when response body only contains integer but content-type header of response says its json#76

Merged
Sammyjo20 merged 2 commits intosaloonphp:v3from
gdebrauwer:telescope-response-logger-fix
Feb 26, 2026
Merged

Fix telescope response middleware when response body only contains integer but content-type header of response says its json#76
Sammyjo20 merged 2 commits intosaloonphp:v3from
gdebrauwer:telescope-response-logger-fix

Conversation

@gdebrauwer
Copy link
Copy Markdown
Contributor

I'm dealing with annoying third-party api call that sends a response with the content-type: application/json header but the response body is just an integer (= an id). Currently the TelescopeResponseMiddleware throws an exception because the decoded 'json' is an integer instead of an array or string. This PR ensures that the middleware does not fail anymore in that case.

@gdebrauwer gdebrauwer changed the title Fix telescope response middleware when response is no json but content-type of response says its json Fix telescope response middleware when response body only contains integer but content-type of response says its json Feb 3, 2026
@gdebrauwer gdebrauwer changed the title Fix telescope response middleware when response body only contains integer but content-type of response says its json Fix telescope response middleware when response body only contains integer but content-type header of response says its json Feb 3, 2026
@JonPurvis
Copy link
Copy Markdown
Collaborator

This fix is good!

@Sammyjo20 Sammyjo20 merged commit 2562dec into saloonphp:v3 Feb 26, 2026
34 checks passed
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.

3 participants