diff --git a/route/question/ask_history.go b/route/question/ask_history.go index 2acdd3f..2bdc083 100644 --- a/route/question/ask_history.go +++ b/route/question/ask_history.go @@ -68,6 +68,8 @@ func askExcerpt(content string) string { // 「某箱主有多少提问」「某个 id 是否存在」—— 错误的组合一律 ok=false, // 与「提问不存在」「不属于该箱主」「token 不对」三种情况无法区分。 func AskStatusAPI(ctx context.Context) error { + // 路由只注册了 POST(token 不能进 URL),这段是防御:万一将来有人把 + // 路由改成 f.Any / f.Combo,GET 也不该走到解析 body 那一步。 if ctx.Request().Method != http.MethodPost { return ctx.JSONError(40500, http.StatusText(http.StatusMethodNotAllowed)) }