From be183206e65408756e07fd44894da106b930333c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 10 May 2020 17:41:16 +0900 Subject: [PATCH] fix(server): Remove koa-compress --- package.json | 2 -- src/server/index.ts | 8 -------- yarn.lock | 35 ++--------------------------------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 3a9bac5e8e..450774b7ce 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "@types/katex": "0.11.0", "@types/koa": "2.11.3", "@types/koa-bodyparser": "4.3.0", - "@types/koa-compress": "2.0.9", "@types/koa-cors": "0.0.0", "@types/koa-favicon": "2.0.19", "@types/koa-logger": "3.1.1", @@ -164,7 +163,6 @@ "katex": "0.11.1", "koa": "2.11.0", "koa-bodyparser": "4.3.0", - "koa-compress": "4.0.1", "koa-favicon": "2.1.0", "koa-json-body": "5.3.0", "koa-logger": "3.2.1", diff --git a/src/server/index.ts b/src/server/index.ts index 2834b5b703..15e1fedc98 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -6,11 +6,9 @@ import * as fs from 'fs'; import * as http from 'http'; import * as http2 from 'http2'; import * as https from 'https'; -import * as zlib from 'zlib'; import * as Koa from 'koa'; import * as Router from '@koa/router'; import * as mount from 'koa-mount'; -const compress = require('koa-compress'); import * as koaLogger from 'koa-logger'; import * as requestStats from 'request-stats'; import * as slow from 'koa-slow'; @@ -48,12 +46,6 @@ if (!['production', 'test'].includes(process.env.NODE_ENV || '')) { } } -// Compress response -app.use(compress({ - flush: zlib.constants.Z_SYNC_FLUSH, - br: false -})); - // HSTS // 6months (15552000sec) if (config.url.startsWith('https') && !config.disableHsts) { diff --git a/yarn.lock b/yarn.lock index 3d560c9c91..2aa6bef44a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -448,14 +448,6 @@ dependencies: "@types/koa" "*" -"@types/koa-compress@2.0.9": - version "2.0.9" - resolved "https://registry.yarnpkg.com/@types/koa-compress/-/koa-compress-2.0.9.tgz#5d19f7d928f78b451a9afd148863e2b45f51e541" - integrity sha512-1Sa9OsbHd2N2N7gLpdIRHe8W99EZbfIR31D7Iisx16XgwZCnWUtGXzXQejhu74Y1pE/wILqBP6VL49ch/MVpZw== - dependencies: - "@types/koa" "*" - "@types/node" "*" - "@types/koa-cors@0.0.0": version "0.0.0" resolved "https://registry.yarnpkg.com/@types/koa-cors/-/koa-cors-0.0.0.tgz#7a0ef45acfed1ef6c046d5896e3974261d8a9d37" @@ -1758,7 +1750,7 @@ busboy@^0.2.11: dicer "0.2.5" readable-stream "1.1.x" -bytes@3.1.0, bytes@^3.0.0, bytes@^3.1.0: +bytes@3.1.0, bytes@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== @@ -2346,13 +2338,6 @@ component-xor@0.0.4: resolved "https://registry.yarnpkg.com/component-xor/-/component-xor-0.0.4.tgz#c55d83ccc1b94cd5089a4e93fa7891c7263e59aa" integrity sha1-xV2DzMG5TNUImk6T+niRxyY+Wao= -compressible@^2.0.0: - version "2.0.18" - resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba" - integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== - dependencies: - mime-db ">= 1.43.0 < 2" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -5314,17 +5299,6 @@ koa-compose@^4.1.0: resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-4.1.0.tgz#507306b9371901db41121c812e923d0d67d3e877" integrity sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw== -koa-compress@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/koa-compress/-/koa-compress-4.0.1.tgz#7a7ed52ce7c3e0cbe918e99e1eaaeba87ec11d48" - integrity sha512-It4WYfsBb9HegnFgcBhiRbPeh1LDjXhRM4+xi2jMp8ujwaVAdqhFzHpbDWuTxbLxuBwStn+Bwdwn2zDZxeNChg== - dependencies: - bytes "^3.0.0" - compressible "^2.0.0" - http-errors "^1.7.3" - koa-is-json "^1.0.0" - statuses "^2.0.0" - koa-convert@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/koa-convert/-/koa-convert-1.2.0.tgz#da40875df49de0539098d1700b50820cebcd21d0" @@ -5941,7 +5915,7 @@ micromatch@^4.0.0: braces "^3.0.1" picomatch "^2.0.5" -mime-db@1.44.0, "mime-db@>= 1.43.0 < 2": +mime-db@1.44.0: version "1.44.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== @@ -8662,11 +8636,6 @@ static-extend@^0.1.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -statuses@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.0.tgz#aa7b107e018eb33e08e8aee2e7337e762dda1028" - integrity sha512-w9jNUUQdpuVoYqXxnyOakhckBbOxRaoYqJscyIBYCS5ixyCnO7nQn7zBZvP9zf5QOPZcz2DLUpE3KsNPbJBOFA== - stealthy-require@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"