at://nekomimi.pet/sh.tangled.repo.issue/3m4myowshah22

Back to Collection

Record JSON

{
  "$type": "sh.tangled.repo.issue",
  "body": "for some reason I can't make a fork to issue a fix\n\nissue:\n\n`uploadBlob` would ignore a set `MimeType` and set it as `*/*` when sent to the PDS\n\nrepro:\n\n```rust\nlet blob = agent.upload_blob(\n        base64_bytes,\n        MimeType::new_static(\"application/octet-stream\"),\n    ).await?;\n```\n\noutput of this code:\n\n```json\njson: {\n  \"blob\": {\n    \"$type\": \"blob\",\n    \"mimeType\": \"*/*\",\n    \"ref\": {\n      \"$link\": \"bafkreiayayykxokf4ml44crf3ez62xyjurt4mashy74bravrgrl52yphvu\"\n    },\n    \"size\": 46828\n  }\n}\n```\n\nfix:\n\nin jacquard/crates/jacquard-common/src/xrpc.rs\n```\n       551\n       552 +      // Check if extra_headers already contains Content-Type\n       553 +      let has_content_type = opts.extra_headers.iter().any(|(name, _)| name == CONTENT_TYPE);\n       554 +\n       555        if let XrpcMethod::Procedure(encoding) = \u003cR as XrpcRequest\u003e::METHOD {\n       556 -          builder = builder.header(Header::ContentType, encoding);\n       556 +          // Only set default Content-Type if not provided in extra_headers\n       557 +          if !has_content_type {\n       558 +              builder = builder.header(Header::ContentType, encoding);\n       559 +          }\n```\n\ntheres probably a better way of doing this, i did this at 1am tired.",
  "createdAt": "2025-11-02T07:36:58Z",
  "repo": "at://did:plc:yfvwmnlztr4dwkb7hwz55r2g/sh.tangled.repo/3lzrya6fcwv22",
  "title": "blob mimeType is hardcoded to be \\*/\\*"
}