Skip to content

server: the upload policy's closed content-type set omits image/jxl, refusing every thumbnail the media stack now encodes #470

Description

@justin13888

What

capsule_server::upload::policy::DEFAULT_CONTENT_TYPES (capsule-server/src/upload/policy.rs) lists jpeg, png, heic, heif, webp, avif, gif, tiff, three video types and application/octet-stream. Since #436 the library's derivative pipeline encodes the thumbnail tier as JXL (capsule_core::derivative_format::DerivativeFormat::is_encodable is Jxl | Original), and the SDK ladder uploads each derivative with content_type = derivative.format (capsule-sdk/src/push.rs::bundle_blobs). The server answers 400 error.upload.unsupported_content_type ("content_type is outside the closed enum this protocol version fixes") for the T1 session, and push_bundle fails.

Every still larger than the thumbnail cap (256 px long edge) hits this; only stills small enough to get the byte-free original sentinel push at all.

Reproduction

capsule-e2e (#409, PR #463): import capsule_e2e::fixtures::large_synthetic_jpeg() (512×512) into a Device and call push_asset — the ladder fails at T1 with the code above. E2E case 2 uses the 8×8 still for that reason and names this issue.

Fix shape

Add image/jxl to the closed set for this protocol version (and decide whether the set is a protocol constant in design/upload-protocol.md), then switch case 2 to the large still so the T1 upload is exercised.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions