mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-09 09:20:54 +00:00
fix: correct filename in content-disposition header (#9139)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
6f26cf0511
commit
4a9a547bf7
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@ -367,9 +367,7 @@
|
||||
"METRICS_CONSOLE": "true",
|
||||
"ACCOUNTS_URL": "http://localhost:3000",
|
||||
"MONGO_URL": "mongodb://localhost:27017",
|
||||
"MINIO_ACCESS_KEY": "minioadmin",
|
||||
"MINIO_SECRET_KEY": "minioadmin",
|
||||
"MINIO_ENDPOINT": "localhost"
|
||||
"STORAGE_CONFIG": "datalake|http://localhost:4030"
|
||||
},
|
||||
"runtimeVersion": "20",
|
||||
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
|
||||
@ -763,8 +761,8 @@
|
||||
"env": {
|
||||
"PORT": "4030",
|
||||
"SECRET": "secret",
|
||||
"DB_URL": "",
|
||||
"BUCKETS": "",
|
||||
"DB_URL": "postgresql://root@localhost:26257/defaultdb?sslmode=disable",
|
||||
"BUCKETS": "blobs,eu|http://localhost:9000?accessKey=minioadmin&secretKey=minioadmin",
|
||||
"ACCOUNTS_URL": "http://localhost:3000",
|
||||
"STATS_URL": "http://huly.local:4900",
|
||||
"STREAM_URL": "http://huly.local:1080/recording"
|
||||
|
@ -70,7 +70,7 @@ export async function handleBlobGet (
|
||||
res.setHeader('Content-Security-Policy', "default-src 'none';")
|
||||
res.setHeader(
|
||||
'Content-Disposition',
|
||||
filename !== undefined ? `attachment; filename*=UTF-8''${encodeURIComponent(filename)}"` : 'attachment'
|
||||
filename !== undefined ? `attachment; filename*=UTF-8''${encodeURIComponent(filename)}` : 'attachment'
|
||||
)
|
||||
res.setHeader('Cache-Control', blob.cacheControl ?? cacheControl)
|
||||
res.setHeader('Last-Modified', new Date(blob.lastModified).toUTCString())
|
||||
@ -122,7 +122,10 @@ export async function handleBlobHead (
|
||||
res.setHeader('Content-Length', head.size.toString())
|
||||
res.setHeader('Content-Type', head.contentType ?? '')
|
||||
res.setHeader('Content-Security-Policy', "default-src 'none';")
|
||||
res.setHeader('Content-Disposition', filename !== undefined ? `attachment; filename="${filename}"` : 'attachment')
|
||||
res.setHeader(
|
||||
'Content-Disposition',
|
||||
filename !== undefined ? `attachment; filename*=UTF-8''${encodeURIComponent(filename)}` : 'attachment'
|
||||
)
|
||||
res.setHeader('Cache-Control', head.cacheControl ?? cacheControl)
|
||||
res.setHeader('Last-Modified', new Date(head.lastModified).toUTCString())
|
||||
res.setHeader('ETag', wrapETag(head.etag))
|
||||
|
Loading…
Reference in New Issue
Block a user