mirror of
https://github.com/outline/outline.git
synced 2026-03-09 06:09:29 -05:00
fix: Move compression middleware to cover all /api and /auth routes
This commit is contained in:
@@ -2,7 +2,6 @@ import crypto from "crypto";
|
||||
import path from "path";
|
||||
import { formatRFC7231 } from "date-fns";
|
||||
import Koa, { BaseContext } from "koa";
|
||||
import compress from "koa-compress";
|
||||
import Router from "koa-router";
|
||||
import send from "koa-send";
|
||||
import userAgent, { UserAgentContext } from "koa-useragent";
|
||||
@@ -92,8 +91,6 @@ if (env.isProduction) {
|
||||
});
|
||||
}
|
||||
|
||||
router.use(compress());
|
||||
|
||||
router.get("/locales/:lng.json", async (ctx) => {
|
||||
const { lng } = ctx.params;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import crypto from "crypto";
|
||||
import { Server } from "https";
|
||||
import Koa from "koa";
|
||||
import compress from "koa-compress";
|
||||
import {
|
||||
contentSecurityPolicy,
|
||||
dnsPrefetchControl,
|
||||
@@ -72,6 +73,7 @@ export default function init(app: Koa = new Koa(), server?: Server) {
|
||||
app.proxy = true;
|
||||
}
|
||||
|
||||
app.use(compress());
|
||||
app.use(mount("/auth", auth));
|
||||
app.use(mount("/api", api));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user