Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(renterd): object download urls #871

Merged
merged 1 commit into from
Jan 9, 2025
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
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
Loading