fix: upload: malformed comments #661

Massimo Melina committed Jul 1, 2024 at 16:29 UTC 02568ba2f32cfbb2dc66d13d40773a19afa14c2e
1 file changed +2 -2
src/upload.ts
+2 -2
@@ -8,7 +8,7 @@ import {
8 } from './const'
9 import { basename, dirname, extname, join } from 'path'
10 import fs from 'fs'
11 -import { Callback, dirTraversal, escapeHTML, loadFileAttr, storeFileAttr, try_ } from './misc'
11 +import { Callback, dirTraversal, loadFileAttr, storeFileAttr, try_ } from './misc'
12 import { notifyClient } from './frontEndApis'
13 import { defineConfig } from './config'
14 import { getDiskSpaceSync } from './util-os'
@@ -112,7 +112,7 @@ export function uploadWriter(base: VfsNode, path: string, ctx: Koa.Context) {
112 if (err)
113 console.error("couldn't rename temp to", dest, String(err))
114 else if (ctx.query.comment)
115 - setCommentFor(dest, escapeHTML(String(ctx.query.comment)))
115 + setCommentFor(dest, String(ctx.query.comment))
116 if (resumable)
117 delayedDelete(resumable, 0)
118 })