diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 20a6f191c..63ea4c83d 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "3.2.30", + "version": "3.2.31", "bin": "bin/hydrooj.js", "main": "src/loader", "module": "src/loader", diff --git a/packages/hydrooj/src/handler/misc.ts b/packages/hydrooj/src/handler/misc.ts index d7ae26485..75e089869 100644 --- a/packages/hydrooj/src/handler/misc.ts +++ b/packages/hydrooj/src/handler/misc.ts @@ -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( diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 3e81a3994..29c53c342 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -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(