core: check content-encoding for proxy

This commit is contained in:
undefined committed 2021-12-25 16:11:38 +08:00
1 parent 4fad7a20bd
commit 849576f071
3 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.2.30",
"version": "3.2.31",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+1
View File
@@ -107,6 +107,7 @@ export class FSDownloadHandler extends Handler {
this.response.etag = file.etag;
this.response.body = await storage.get(target);
this.response.type = file['Content-Type'] || type;
if (file['Content-Encoding']) this.response.addHeader('Content-Encoding', file['Content-Encoding']);
if (!noDisposition) this.response.disposition = `attachment; filename=${encodeURIComponent(filename)}`;
} else {
this.response.redirect = await storage.signDownloadLink(
+1
View File
@@ -629,6 +629,7 @@ export class ProblemFileDownloadHandler extends ProblemDetailHandler {
this.response.etag = file.etag;
this.response.body = await storage.get(target);
this.response.type = file['Content-Type'] || fileType;
if (file['Content-Encoding']) this.response.addHeader('Content-Encoding', file['Content-Encoding']);
if (!noDisposition) this.response.disposition = `attachment; filename=${encodeURIComponent(filename)}`;
} else {
this.response.redirect = await storage.signDownloadLink(