From df0e6cff496811a4284499dc901cb96e951e941c Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 13 Dec 2022 23:38:48 +0800 Subject: [PATCH] perf: change the maximum limit of request body to 10MB (#2936) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement #### What this PR does / why we need it: 将 http 请求体的最大字节数改为 10m。 Ref https://github.com/halo-dev/halo/issues/2861#issuecomment-1339526589 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2861 #### Special notes for your reviewer: 测试方式: 1. 在 Console 端新建文章,保存大量文本内容(最快方式是截图或者复制图片到编辑器,这时候因为会转为 base64,所以内容会很大) 2. 保存文章,检查是否成功。 #### Does this PR introduce a user-facing change? ```release-note 修改 HTTP 请求体最大字节数的限制,修复保存大内容文章异常的问题。 ``` --- src/main/resources/application.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 991a13951..0028daa85 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -14,6 +14,8 @@ spring: init: mode: always platform: h2 + codec: + max-in-memory-size: 10MB halo: external-url: "http://${server.address:localhost}:${server.port}"