fix: upload: "copy links" was not including proxy path prefix #1160
Massimo Melina committed
Jan 28, 2026 at 10:12 UTC
d8ecda2c5de0475a188ab4562de36d0bbd407e58
3 files changed
+4
-3
frontend/src/upload.ts
+2
-1
@@ -5,6 +5,7 @@ import { Btn, Flex, FlexV, iconBtn, Select } from './components'
5
import {
6
basename, formatBytes, formatPerc, hIcon, useIsMobile, newDialog, selectFiles, working, copyTextToClipboard,
7
HTTP_CONFLICT, formatSpeed, getHFS, onlyTruthy, cpuSpeedIndex, closeDialog, prefix, operationSuccessful, pathEncode,
8
+ getPrefixUrl,
9
} from './misc'
10
import _ from 'lodash'
11
import { INTERNAL_Snapshot, ref, useSnapshot } from 'valtio'
@@ -227,7 +228,7 @@ export function UploadStatus({ snapshot, ...props }: { snapshot?: INTERNAL_Snaps
228
asText: true,
229
successFeedback: true,
230
async onClick() {
230
- await copyTextToClipboard(done.map(x => location.origin + x.response.uri).join('\n'))
231
+ await copyTextToClipboard(done.map(x => location.origin + getPrefixUrl() + x.response.uri).join('\n'))
232
operationSuccessful()
233
}
234
}),
shared/index.ts
+1
-1
@@ -130,7 +130,7 @@ export function getHFS() {
130
}
131
132
export function getPrefixUrl() {
133
- return getHFS().prefixUrl || ''
133
+ return getHFS().prefixUrl
134
}
135
136
export function makeSessionRefresher(state: any) {
src/serveGuiFiles.ts
+1
-1
@@ -106,7 +106,7 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
106
session: session instanceof ApiError ? null : session,
107
plugins,
108
loadScripts: Object.fromEntries(mapPlugins((p, id) => [id, p.frontend_js?.map(f => f.includes('//') ? f : pub + id + '/' + f)])),
109
- prefixUrl: ctx.state.revProxyPath,
109
+ prefixUrl: ctx.state.revProxyPath || '',
110
proxyDetected: Boolean(getProxyDetected()),
111
dontOverwriteUploading: dontOverwriteUploading.get(),
112
splitUploads: splitUploads.get(),