mirror of
https://github.com/Comfy-Org/comfy-python-sdk.git
synced 2026-11-04 23:37:47 +00:00
[PR #13] [MERGED] feat: output.get_download_url() + SDK User-Agent identification #21
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
effort:medium
effort:small
effort:small
effort:trivial
priority:nice-to-have
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-python-sdk#21
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-python-sdk/pull/13
Author: @wei-hai
Created: 7/23/2026
Status: ✅ Merged
Merged: 7/23/2026
Merged by: @wei-hai
Base:
main← Head:feat/output-get-download-url📝 Commits (3)
997acd9feat: output.get_download_url() + SDK User-Agent identificationefa87c4harden: reject CR/LF in client_info to prevent header injection0faed84fix: treat overflowing X-Goog-Expires as no-expiry (return None)📊 Changes
8 files changed (+404 additions, -21 deletions)
View changed files
📝
README.md(+9 -0)📝
src/comfy_low/transport.py(+117 -5)📝
src/comfy_sdk/__init__.py(+2 -1)📝
src/comfy_sdk/client.py(+4 -2)📝
src/comfy_sdk/outputs.py(+36 -1)📝
tests/conftest.py(+25 -12)➕
tests/test_get_download_url.py(+170 -0)➕
tests/test_user_agent.py(+41 -0)📄 Description
What
Output.get_download_url()(sync + async) →DownloadUrl{ url, expires_at }: a directly-fetchable URL for an output, so a caller (e.g. a serverless worker) can hand the URL to a downstream consumer without streaming the bytes through itself.Location) + its expiry.expires_at=None.User-Agentidentification on every request:comfy-sdk-python/{version} ({runtime}), with an optionalclient_info="my-app"appending anapp/my-apptoken so an integration can attribute its own traffic. Request metadata only — not telemetry, no phone-home; a caller-suppliedUser-Agentstill wins.How
get_asset_content_url()issuesGET /assets/{id}/contentwith a per-requestfollow_redirects=False(the shared client default is untouched), reads the redirectLocationwithout following it (so the bearer can't leak cross-origin), and parses the GCS V4X-Goog-Date/X-Goog-Expiresparams for the expiry.Tests
pytest— 90 passed (incl. cloud-redirect, self-hosted-inline, multi-output-distinct-URLs, bearer-not-leaked, User-Agent format +client_infoappend).ruff+mypyclean. No OpenAPI/contract change (sameGET /assets/{id}/contentoperation).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.