[PR #13] [MERGED] fix: send multipart content_type before the file part on asset upload #23

Closed
opened 2026-10-31 22:03:55 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-typescript-sdk/pull/13
Author: @wei-hai
Created: 7/22/2026
Status: ✅ Merged
Merged: 7/22/2026
Merged by: @wei-hai

Base: main ← Head: fix/multipart-order-and-notfound


📝 Commits (2)

  • f672d36 fix: send multipart content_type before the file part on asset upload
  • 60a8cc1 fix: map entity-specific 404 codes (job/asset_not_found) to NotFound

📊 Changes

5 files changed (+33 additions, -1 deletions)

View changed files

📝 src/low/errors.test.ts (+2 -0)
📝 src/low/errors.ts (+5 -0)
📝 src/low/transport.test.ts (+7 -0)
📝 src/low/transport.ts (+5 -1)
📝 test/support/stub-server.ts (+14 -0)

📄 Description

Asset upload against public-api failed with:

422 invalid_body: content_type is required and must be sent before the file field

public-api streams the multipart upload and needs content_type (and the other metadata fields) to arrive before the file part so it can route the file stream without buffering. postAssets appended file first.

Fix: append the metadata fields (content_type, file_path, expected_hash, tags) first and file last. The stub server now rejects a file-before-content_type body (mirroring public-api), so the existing postAssets tests guard against a regression. vitest 112/112, tsc/oxfmt/hygiene clean.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-typescript-sdk/pull/13 **Author:** [@wei-hai](https://github.com/wei-hai) **Created:** 7/22/2026 **Status:** ✅ Merged **Merged:** 7/22/2026 **Merged by:** [@wei-hai](https://github.com/wei-hai) **Base:** `main` ← **Head:** `fix/multipart-order-and-notfound` --- ### 📝 Commits (2) - [`f672d36`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/f672d369f5a255f94ca696bbfab81cfda3d2cf15) fix: send multipart content_type before the file part on asset upload - [`60a8cc1`](https://github.com/Comfy-Org/comfy-typescript-sdk/commit/60a8cc162a156109ac64bc956cf4673be1f2a375) fix: map entity-specific 404 codes (job/asset_not_found) to NotFound ### 📊 Changes **5 files changed** (+33 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/low/errors.test.ts` (+2 -0) 📝 `src/low/errors.ts` (+5 -0) 📝 `src/low/transport.test.ts` (+7 -0) 📝 `src/low/transport.ts` (+5 -1) 📝 `test/support/stub-server.ts` (+14 -0) </details> ### 📄 Description Asset upload against public-api failed with: ``` 422 invalid_body: content_type is required and must be sent before the file field ``` public-api streams the multipart upload and needs `content_type` (and the other metadata fields) to arrive **before** the `file` part so it can route the file stream without buffering. `postAssets` appended `file` first. **Fix:** append the metadata fields (`content_type`, `file_path`, `expected_hash`, `tags`) first and `file` **last**. The stub server now rejects a `file`-before-`content_type` body (mirroring public-api), so the existing `postAssets` tests guard against a regression. `vitest` 112/112, `tsc`/`oxfmt`/hygiene clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 22:03:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-typescript-sdk#23
No description provided.