Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
severo committed Dec 5, 2024
1 parent 5472fc9 commit 2d03590
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/hub/src/lib/file-download-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function fileDownloadInfo(
const resp = await (params.fetch ?? fetch)(url, {
method: "GET",
headers: {
...(params.credentials && {
...(accessToken && {
Authorization: `Bearer ${accessToken}`,
}),
Range: "bytes=0-0",
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/list-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export async function* listModels<
const res: Response = await (params?.fetch ?? fetch)(url, {
headers: {
accept: "application/json",
...(params?.credentials ? { Authorization: `Bearer ${accessToken}` } : undefined),
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined),
},
});

Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/list-spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function* listSpaces<
const res: Response = await (params?.fetch ?? fetch)(url, {
headers: {
accept: "application/json",
...(params?.credentials ? { Authorization: `Bearer ${accessToken}` } : undefined),
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : undefined),
},
});

Expand Down
2 changes: 1 addition & 1 deletion packages/hub/src/lib/paths-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function pathsInfo(
const resp = await (params.fetch ?? fetch)(url, {
method: "POST",
headers: {
...(params.credentials && {
...(accessToken && {
Authorization: `Bearer ${accessToken}`,
}),
Accept: "application/json",
Expand Down

0 comments on commit 2d03590

Please sign in to comment.