fix(deps): @bobbywibowo/serve-static

the fork is now named under @bobbywibowo tag to allow it co-existing
with upstream version within the same scope if required

it and @bobbywibowo/send have also been aligned with their respective
latest master commits as of this commit date
This commit is contained in:
Bobby 2022-03-04 02:57:21 +07:00
parent 5584b6b3df
commit 3050de43c4
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09
3 changed files with 54 additions and 33 deletions

View File

@ -19,7 +19,7 @@ const nunjucks = require('nunjucks')
const path = require('path')
const RateLimit = require('express-rate-limit')
const readline = require('readline')
const serveStatic = require('serve-static')
const serveStatic = require('@bobbywibowo/serve-static')
const { accessSync, constants } = require('fs')
// Check required config files
@ -133,9 +133,9 @@ const initServeStaticUploads = (opts = {}) => {
logger.error(error)
}
}
// serveStatic is just a modified express/serve-static module that allows specifying
// an async setHeaders function by the name preSetHeaders.
// The module will wait for the said function before creating send stream to client.
// serveStatic is provided with @bobbywibowo/serve-static, a fork of express/serve-static.
// The fork allows specifying an async setHeaders function by the name preSetHeaders.
// It will await the said function before creating 'send' stream to client.
safe.use('/', serveStatic(paths.uploads, opts))
} else {
safe.use('/', express.static(paths.uploads, opts))

View File

@ -34,6 +34,7 @@
"full-upgrade": "rm -f ./yarn.lock && yarn"
},
"dependencies": {
"@bobbywibowo/serve-static": "git+https://git@github.com/BobbyWibowo/serve-static#2cd43e81a9cb79aaa23286d0f63642de96368750",
"bcrypt": "~5.0.1",
"blake3": "~2.1.7",
"body-parser": "~1.19.0",
@ -51,7 +52,6 @@
"randomstring": "~1.2.1",
"readline": "~1.3.0",
"search-query-parser": "~1.6.0",
"serve-static": "git+https://git@github.com/BobbyWibowo/serve-static#02c26587b25a7156a89dc05b617fce0aa90cefb9",
"sharp": "~0.30.2",
"sqlite3": "~5.0.2",
"systeminformation": "~5.11.6"

View File

@ -23,6 +23,33 @@
chalk "^2.0.0"
js-tokens "^4.0.0"
"@bobbywibowo/send@git+https://git@github.com/BobbyWibowo/send#c31558c3fc68d1f5061adfbc2600df5174e37c14":
version "0.17.2-alpha"
resolved "git+https://git@github.com/BobbyWibowo/send#c31558c3fc68d1f5061adfbc2600df5174e37c14"
dependencies:
debug "2.6.9"
depd "~1.1.2"
destroy "~1.0.4"
encodeurl "~1.0.2"
escape-html "~1.0.3"
etag "~1.8.1"
fresh "0.5.2"
http-errors "1.8.1"
mime "1.6.0"
ms "2.1.3"
on-finished "~2.3.0"
range-parser "~1.2.1"
statuses "~1.5.0"
"@bobbywibowo/serve-static@git+https://git@github.com/BobbyWibowo/serve-static#2cd43e81a9cb79aaa23286d0f63642de96368750":
version "1.14.2-alpha"
resolved "git+https://git@github.com/BobbyWibowo/serve-static#2cd43e81a9cb79aaa23286d0f63642de96368750"
dependencies:
"@bobbywibowo/send" "git+https://git@github.com/BobbyWibowo/send#c31558c3fc68d1f5061adfbc2600df5174e37c14"
encodeurl "~1.0.2"
escape-html "~1.0.3"
parseurl "~1.3.3"
"@csstools/postcss-color-function@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@csstools/postcss-color-function/-/postcss-color-function-1.0.2.tgz#0843fe19be08eeb22e5d2242a6ac06f8b87b9ed2"
@ -3251,6 +3278,17 @@ http-errors@1.7.2:
statuses ">= 1.5.0 < 2"
toidentifier "1.0.0"
http-errors@1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c"
integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==
dependencies:
depd "~1.1.2"
inherits "2.0.4"
setprototypeof "1.2.0"
statuses ">= 1.5.0 < 2"
toidentifier "1.0.1"
http-errors@~1.7.2:
version "1.7.3"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06"
@ -4420,7 +4458,7 @@ ms@2.1.2:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
ms@^2.1.1:
ms@2.1.3, ms@^2.1.1:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
@ -6208,24 +6246,6 @@ send@0.17.1:
range-parser "~1.2.1"
statuses "~1.5.0"
"send@git+https://git@github.com/BobbyWibowo/send#12954661e56df4f7760d4bdee284b69911d0338d":
version "0.17.2"
resolved "git+https://git@github.com/BobbyWibowo/send#12954661e56df4f7760d4bdee284b69911d0338d"
dependencies:
debug "2.6.9"
depd "~1.1.2"
destroy "~1.0.4"
encodeurl "~1.0.2"
escape-html "~1.0.3"
etag "~1.8.1"
fresh "0.5.2"
http-errors "~1.7.2"
mime "1.6.0"
ms "2.1.1"
on-finished "~2.3.0"
range-parser "~1.2.1"
statuses "~1.5.0"
serve-static@1.14.1:
version "1.14.1"
resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9"
@ -6236,15 +6256,6 @@ serve-static@1.14.1:
parseurl "~1.3.3"
send "0.17.1"
"serve-static@git+https://git@github.com/BobbyWibowo/serve-static#02c26587b25a7156a89dc05b617fce0aa90cefb9":
version "1.14.2"
resolved "git+https://git@github.com/BobbyWibowo/serve-static#02c26587b25a7156a89dc05b617fce0aa90cefb9"
dependencies:
encodeurl "~1.0.2"
escape-html "~1.0.3"
parseurl "~1.3.3"
send "git+https://git@github.com/BobbyWibowo/send#12954661e56df4f7760d4bdee284b69911d0338d"
set-blocking@^2.0.0, set-blocking@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
@ -6270,6 +6281,11 @@ setprototypeof@1.1.1:
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683"
integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==
setprototypeof@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
sharp@~0.30.2:
version "0.30.2"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.30.2.tgz#95b309b2740424702dc19b62a62595dd34a458b1"
@ -7068,6 +7084,11 @@ toidentifier@1.0.0:
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==
toidentifier@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35"
integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==
touch@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b"