mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: check content-encoding for proxy
This commit is contained in:
1 parent
4fad7a20bd
commit
849576f071
3 files changed
+3
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.2.30",
|
||||
"version": "3.2.31",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user