Skip to content

Commit e1cca3a

Browse files
authored
xet: fix uploading to a branch with a slash in it (#1757)
https://huggingface.slack.com/archives/C02EMARJ65P/p1758197331824889
1 parent 5549274 commit e1cca3a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/hub/src/utils/xetWriteToken.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export async function xetWriteToken(params: XetWriteTokenParams): Promise<{ acce
4747

4848
const promise = (async () => {
4949
const resp = await (params.fetch ?? fetch)(
50-
`${params.hubUrl}/api/${params.repo.type}s/${params.repo.name}/xet-write-token/${params.rev}` +
51-
(params.isPullRequest ? "?create_pr=1" : ""),
50+
`${params.hubUrl}/api/${params.repo.type}s/${params.repo.name}/xet-write-token/${encodeURIComponent(
51+
params.rev
52+
)}` + (params.isPullRequest ? "?create_pr=1" : ""),
5253
{
5354
headers: params.accessToken
5455
? {

0 commit comments

Comments
 (0)