gzip middleware keeps Content-Length: EXR preview fails with ERR_CONTENT_LENGTH_MISMATCH #25
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
blocked
draft
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/jiggablend#25
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?
EXR Preview modal always shows "Failed to load preview image." Browser console: net::ERR_CONTENT_LENGTH_MISMATCH on /api/jobs/{id}/files/{fileId}/preview-exr.
Root cause: gzipMiddleware (internal/manager/manager.go ~L471) gzips the body but leaves the handler's Content-Length (uncompressed size). Proof on 0.0.11:
Fix: drop Content-Length in the gzip wrapper before WriteHeader, and skip gzip for already-compressed types (image/png, zip, file downloads). Likely affects every endpoint that sets Content-Length.
Done = preview loads in Chrome/Brave, curl --compressed exits 0, release cut. Filed by Jerry for Justin.
Clear spec and repro, so this goes straight to implementation. Keep the fix in the gzip wrapper (drop Content-Length before WriteHeader, skip already-compressed types), add a test that a gzipped response decodes cleanly, leave the Go version alone, and don't merge yourself. A release cut follows the merge.