Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion comfy_cli/command/generate/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _refresh() -> None:
url = spec.base_url() + "/openapi.yml"
try:
with httpx.Client(timeout=30.0, follow_redirects=True) as cli:
r = cli.get(url, headers={"X-Comfy-Env": "comfy-cli", "User-Agent": "comfy-cli/api"})
r = cli.get(url, headers={"Comfy-Env": "comfy-cli", "User-Agent": "comfy-cli/api"})
r.raise_for_status()
except httpx.HTTPError as e:
rprint(f"[bold red]Failed to fetch {url}: {e}[/bold red]")
Expand Down
2 changes: 1 addition & 1 deletion comfy_cli/command/generate/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _auth_headers(api_key: str, extra: dict[str, str] | None = None) -> dict[str
# - "comfyui-..." API keys → X-API-Key (validated by sha256 lookup)
# - Firebase ID tokens → Authorization: Bearer (validated as a JWT)
# See comfy-api server/middleware/authentication/comfy_firebase_auth.go.
headers = {"User-Agent": "comfy-cli/api", "X-Comfy-Env": "comfy-cli"}
headers = {"User-Agent": "comfy-cli/api", "Comfy-Env": "comfy-cli"}
if api_key.startswith("comfyui-"):
headers["X-API-Key"] = api_key
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/comfy_cli/command/generate/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def get(self, url, headers=None):
assert r.exit_code == 0, r.stdout
assert "Refreshed" in r.stdout
assert (tmp_path / "openapi-cache.yml").exists()
assert captured["headers"].get("X-Comfy-Env") == "comfy-cli"
assert captured["headers"].get("Comfy-Env") == "comfy-cli"


def test_refresh_network_failure(runner, monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion tests/comfy_cli/command/generate/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_send_request_uses_x_api_key_for_comfyui_keys(monkeypatch):
client.send_request(ep, {"prompt": "x", "width": 1, "height": 1}, flags, api_key="comfyui-abc")
assert captured["headers"]["X-API-Key"] == "comfyui-abc"
assert "Authorization" not in captured["headers"]
assert captured["headers"]["X-Comfy-Env"] == "comfy-cli"
assert captured["headers"]["Comfy-Env"] == "comfy-cli"


def test_send_request_uses_bearer_for_firebase_tokens(monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion tests/comfy_cli/command/generate/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def fake_post(url, *, json=None, headers=None, timeout=None):
assert body["upload_url"] == "https://signed/up"
assert captured["json"] == {"file_name": "cat.png", "content_type": "image/png", "file_hash": "deadbeef"}
assert captured["headers"]["X-API-Key"] == "comfyui-test"
assert captured["headers"]["X-Comfy-Env"] == "comfy-cli"
assert captured["headers"]["Comfy-Env"] == "comfy-cli"
assert captured["url"].endswith("/customers/storage")


Expand Down
Loading