Skip to content

Commit 0c1897a

Browse files
gavrielcclaude
andcommitted
fix: blank the secret_url path instead of /*
A bare * in the pre-filled secret_url path doesn't survive (the gateway URL-encodes everything, so an unencoded * collapses to just /, which only exact-matches the path /). Leave the path blank instead so the created secret matches all of huggingface.co, not a single endpoint. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d16b24d commit 0c1897a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

container/agent-runner/src/upload-trace.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ function notSignedInMessage(body: string): string {
7676
const e = JSON.parse(body) as { secret_url?: string; connect_url?: string; manage_url?: string };
7777
if (e.secret_url) {
7878
// The pre-filled `path` defaults to the failing request path
79-
// (/api/whoami-v2); broaden it to /* so the secret covers the upload
80-
// endpoints too, not just whoami.
81-
setupUrl = e.secret_url.replace(/([?&]path=)[^&]*/, '$1%2F*');
79+
// (/api/whoami-v2), which scopes the secret to that one endpoint. Blank
80+
// it so the secret matches all of huggingface.co — the upload endpoints
81+
// included, not just whoami.
82+
setupUrl = e.secret_url.replace(/([?&]path=)[^&]*/, '$1');
8283
} else {
8384
setupUrl = e.connect_url ?? e.manage_url;
8485
}

0 commit comments

Comments
 (0)