fix: Server error if X-Editor-Version is not valid semver string
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import { Context } from "koa";
|
||||
import { Context, Next } from "koa";
|
||||
import queryString from "query-string";
|
||||
|
||||
export default function methodOverride() {
|
||||
return async function methodOverrideMiddleware(
|
||||
ctx: Context,
|
||||
next: () => Promise<any>
|
||||
) {
|
||||
return async function methodOverrideMiddleware(ctx: Context, next: Next) {
|
||||
if (ctx.method === "POST") {
|
||||
ctx.body = ctx.request.body;
|
||||
} else if (ctx.method === "GET") {
|
||||
|
||||
Reference in New Issue
Block a user