fix: Server error if X-Editor-Version is not valid semver string
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import { Context } from "koa";
|
||||
import { Context, Next } from "koa";
|
||||
|
||||
export default function apexRedirect() {
|
||||
return async function apexRedirectMiddleware(
|
||||
ctx: Context,
|
||||
next: () => Promise<any>
|
||||
) {
|
||||
return async function apexRedirectMiddleware(ctx: Context, next: Next) {
|
||||
if (ctx.headers.host === "getoutline.com") {
|
||||
ctx.redirect(`https://www.${ctx.headers.host}${ctx.path}`);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user