mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3660] [Issue]: safeFetch rejects missing Content-Type and doesn't decompress gzip JSON responses #1979
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1979
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Lamboozled on GitHub (Jul 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3660
Originally assigned to: @SpicyMarinara on GitHub.
Summary
safeFetchrejects responses with a missingContent-Typeheader and fails to decompress gzip-encoded JSON responses, causing card browser API calls and the capability package catalog to fail on every server start.Expected behavior
Card browser JSON endpoints and the capability package catalog load successfully regardless of whether the upstream server omits
Content-Typeor returns a gzip-compressed response body.Actual behavior
Server logs "Outbound response content type is not allowed: " (empty string) for any response missing a
Content-Typeheader. After fixing that, gzip responses from GitHub raw content and card browser APIs causeresponse.json()to throwSyntaxError: Unexpected token '\u001f'becausereadCappedResponsereads the raw byte stream directly, bypassing undici's built-inContent-Encodingdecompression.Steps to reproduce
Outbound response content type is not allowed:and/orSyntaxError: Unexpected token '\u001f'in server logEnvironment
Logs, screenshots, or video
{"err":{"message":"Outbound response content type is not allowed: "},"msg":"Optional package availability migration did not complete; it will retry next startup"}
{"err":{"message":"Unexpected token '\u001f', "\u001f\x8b\x08\x00..." is not valid JSON"},"msg":"Unexpected token..."}
Additional context
safeFetch'sallowedContentTypesguard uses!contentType ||which should becontentType &&— same||bug fixed in the avatar image proxy paths. The gzip issue is separate:readCappedResponseusesresponse.body.getReader()directly which bypasses undici decompression;decodeCompressedResponse: trueis the existing opt-in fix.Template check
@SpicyMarinara commented on GitHub (Jul 15, 2026):
Thank you for the PR, checking it our right now!