Tune download (#2)

* s2-2

* allowedPrivateNetworks

* style

* Proxyの間にあると誤解しそうなのでconfigの記述順を変更

* Fix error handler
This commit is contained in:
MeiMei 2021-09-03 21:00:44 +09:00 committed by syuilo
parent 7e30910ab8
commit e1a8b158e0
7 changed files with 106 additions and 23 deletions

View file

@ -39,8 +39,8 @@ export async function proxyMedia(ctx: Koa.Context) {
} catch (e) {
serverLogger.error(e);
if (typeof e == 'number' && e >= 400 && e < 500) {
ctx.status = e;
if (typeof e.statusCode === 'number' && e.statusCode >= 400 && e.statusCode < 500) {
ctx.status = e.statusCode;
} else {
ctx.status = 500;
}