Skip to content

Commit

Permalink
fix(renterd): object download urls
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Jan 9, 2025
1 parent c9477b9 commit 56630e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-coins-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'renterd': patch
---

The copyable file download URLs in the file context menu have been updated to match the new API.
6 changes: 5 additions & 1 deletion apps/renterd/contexts/filesManager/downloads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
getKeyFromPath,
} from '../../lib/paths'
import { ObjectData } from './types'
import { workerObjectKeyRoute } from '@siafoundation/renterd-types'

type DownloadProgress = ObjectData & {
controller: AbortController
Expand Down Expand Up @@ -167,7 +168,10 @@ export function useDownloads() {
const getFileUrl = useCallback(
(path: FullPath, authenticated: boolean) => {
const { bucket, key } = bucketAndKeyParamsFromPath(path)
const workerPath = `/worker/objects/${key}?bucket=${bucket}`
const workerPath = `${workerObjectKeyRoute.replace(
':key',
key
)}?bucket=${bucket}`
// Parse settings.api if its set otherwise URL
const origin = settings.api || location.origin
const scheme = origin.startsWith('https') ? 'https' : 'http'
Expand Down

0 comments on commit 56630e1

Please sign in to comment.