mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #36592 from overleaf/ar-remove-unused-output-zip-query-params
[web] remove unused query params from download all link GitOrigin-RevId: e6c1ac8d8c7f369d7ea99c39ed0f0c3c596580b7
This commit is contained in:
@@ -356,20 +356,6 @@ const getOutputZipFromClsiSchema = z.object({
|
||||
}),
|
||||
query: z.object({
|
||||
clsiserverid: zz.clsiServerId().optional(),
|
||||
// frontend's buildFileList always appends editorId/compileGroup, and
|
||||
// (for the "Download all" archive link specifically) one `files` entry
|
||||
// per output file, to the query string it builds
|
||||
// (services/web/frontend/js/features/pdf-preview/util/file-list.ts).
|
||||
// None of these three are read by the handler below -- the backend
|
||||
// already knows the build's full file list -- they're carried along
|
||||
// only because the archive URL is built from the same query-params
|
||||
// object as the per-file download links.
|
||||
editorId: z.uuid().optional(),
|
||||
compileGroup: zz.compileGroup().optional(),
|
||||
// a single file in the archive arrives as a bare string, not a
|
||||
// one-element array -- Express's query parser only produces an array
|
||||
// once a query key repeats
|
||||
files: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
// not consumed, traffic tag
|
||||
enable_pdf_caching: z.stringbool().optional(),
|
||||
}),
|
||||
|
||||
@@ -82,12 +82,17 @@ export function buildFileList(
|
||||
const archivableFiles = [...files.top, ...files.other]
|
||||
|
||||
if (outputFilesArchive && archivableFiles.length > 0) {
|
||||
archivableFiles.forEach(file => params.append('files', file.path))
|
||||
const archiveParams = new URLSearchParams()
|
||||
let archiveUrl = outputFilesArchive.url
|
||||
if (params.has('clsiserverid')) {
|
||||
archiveParams.set('clsiserverid', params.get('clsiserverid')!)
|
||||
archiveUrl = `${outputFilesArchive.url}?${archiveParams.toString()}`
|
||||
}
|
||||
|
||||
files.archive = {
|
||||
...outputFilesArchive,
|
||||
fileCount: archivableFiles.length,
|
||||
url: `${outputFilesArchive.url}?${params.toString()}`,
|
||||
url: archiveUrl,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user