mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #21] [MERGED] fix: resolve host-relative follow-up links against the origin, not baseUrl #33
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
bug
cursor-review-pin
effort:medium
effort:small
effort:trivial
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-typescript-sdk#33
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?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-typescript-sdk/pull/21
Author: @sundar-svg
Created: 7/23/2026
Status: ✅ Merged
Merged: 7/24/2026
Merged by: @sundar-svg
Base:
main← Head:sundar/host-relative-follow-up-links📝 Commits (1)
684168efix: resolve host-relative follow-up links against the origin, not baseUrl📊 Changes
2 files changed (+89 additions, -1 deletions)
View changed files
➕
src/low/followUpLinks.test.ts(+79 -0)📝
src/low/transport.ts(+10 -1)📄 Description
Description
TypeScript mirror of Comfy-Org/ComfyPythonSDK#17 — the same bug existed verbatim in
urlFor(src/low/transport.ts).The serverless gateway serves the v2 contract under
/deployment/{id}/api/v2and returnsjob.urls.*follow-up links that are host-relative and already include that mount prefix.urlForonly recognized links starting with/api/, so a gateway self link fell into the internal-shorthand branch and was built asbaseUrl + /api/v2 + link→ double prefix → 404 on the first poll after submit.Fix: a leading-slash path containing
/api/is a server-returned link and resolves against the origin — the link is authoritative about its own path. Internal shorthand paths (/jobs/…,/assets…) still resolve underbaseUrl + /api/v2; Cloud / self-hosted construction is byte-identical (baseUrl == origin there); auth attachment is unaffected (same origin, existingisSameOriginlogic).The resolution rule is being pinned in the contract itself: Comfy-Org/cloud#5498 documents it on the
JobUrlsschema.How tested
pnpm test— 134 passed (130 existing + 4 new resolution/auth regression tests insrc/low/followUpLinks.test.ts, driven through a capturingfetchso the full request path is exercised)pnpm lint,pnpm typecheckclean🤖 Generated with Claude Code
https://claude.ai/code/session_01KV7wUb2hyzKHsR52ZJTvAm
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.