Skip to content

Fix command JSON responses downloaded as a file when Content-Type has a charset - #790

Merged
aguingand merged 1 commit into
10.xfrom
fix-blob-content-type-with-charset
Oct 21, 2026
Merged

aguingand merged 1 commit into
10.xfrom
fix-blob-content-type-with-charset

Conversation

@aguingand

@aguingand aguingand commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

On some hosts (e.g. Laravel Cloud), JSON responses are sent with Content-Type: application/json; charset=utf-8. Since commands are posted with responseType: 'blob', Blob.type holds the full header, so the strict !== 'application/json' check in CommandManager treated the response as a file and downloaded it as download.json.

This adds a blobHasMimeType() helper that compares only the MIME type (ignoring parameters and case), used in:

  • CommandManager::handleCommandApiResponse()
  • the axios error interceptor (application/json and text/html blob checks)

🤖 Generated with Claude Code

Close #785

Blob.type holds the full Content-Type header, so a reply sent as
"application/json; charset=utf-8" (e.g. on Laravel Cloud) was treated
as a file and downloaded instead of being handled as a command response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aguingand
aguingand changed the base branch from 9.x to 10.x October 21, 2026 12:29
@aguingand
aguingand force-pushed the fix-blob-content-type-with-charset branch from f1cdb3a to b13cd98 Compare October 21, 2026 12:29
@aguingand
aguingand merged commit 9b9ccc8 into 10.x Oct 21, 2026
7 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.

[10.x] Strange behavior on Laravel Cloud environment: commands can lead to json file DL

1 participant