From 22a39bb961daedccb08e47cb4cf83b2d4ef72108 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Tue, 13 Jun 2023 18:02:25 +0900 Subject: Fix profile render when the README.md size is larger than 1024 bytes (#25131) Fixes https://github.com/go-gitea/gitea/issues/25094 `GetBlobContent` will only get the first 1024 bytes, if the README.md size is larger than 1024 bytes, We can not render the rest of them. After this fix, we should provide the limited size to read when call `GetBlobContent`. After: ![image](https://github.com/go-gitea/gitea/assets/18380374/22a42936-4cf8-40b4-a5c7-e384082beb0d) --------- Co-authored-by: wxiaoguang --- models/issues/pull.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models') diff --git a/models/issues/pull.go b/models/issues/pull.go index 23b938f95a..2acc2b4226 100644 --- a/models/issues/pull.go +++ b/models/issues/pull.go @@ -920,7 +920,7 @@ func PullRequestCodeOwnersReview(ctx context.Context, pull *Issue, pr *PullReque var data string for _, file := range files { if blob, err := commit.GetBlobByPath(file); err == nil { - data, err = blob.GetBlobContent() + data, err = blob.GetBlobContent(setting.UI.MaxDisplayFileSize) if err == nil { break } -- cgit v1.2.3