mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-27 15:16:43 -06:00
Fix Content-Length resetting for partial content length requests
This commit is contained in:
parent
0de55e3e74
commit
3dc92ee27b
1 changed files with 3 additions and 1 deletions
|
@ -171,6 +171,9 @@ export class FileServerService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set Content-Length before we chunk, so it can properly override when chunking.
|
||||||
|
reply.header('Content-Length', file.file.size);
|
||||||
|
|
||||||
if (!image) {
|
if (!image) {
|
||||||
if (request.headers.range && file.file.size > 0) {
|
if (request.headers.range && file.file.size > 0) {
|
||||||
const range = request.headers.range as string;
|
const range = request.headers.range as string;
|
||||||
|
@ -214,7 +217,6 @@ export class FileServerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(image.type) ? image.type : 'application/octet-stream');
|
reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(image.type) ? image.type : 'application/octet-stream');
|
||||||
reply.header('Content-Length', file.file.size);
|
|
||||||
reply.header('Cache-Control', 'max-age=31536000, immutable');
|
reply.header('Cache-Control', 'max-age=31536000, immutable');
|
||||||
reply.header('Content-Disposition',
|
reply.header('Content-Disposition',
|
||||||
contentDisposition(
|
contentDisposition(
|
||||||
|
|
Loading…
Reference in a new issue