diff options
author | yp05327 <576951401@qq.com> | 2023-06-13 18:02:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-13 09:02:25 +0000 |
commit | 22a39bb961daedccb08e47cb4cf83b2d4ef72108 (patch) | |
tree | 5a98a90df3293ea75754db5e64d4d7f5f43be9f5 /services/repository/files | |
parent | a583c5630629fa664e77bad62afe95c0d9fb0a5e (diff) | |
download | gitea-22a39bb961daedccb08e47cb4cf83b2d4ef72108.tar.gz gitea-22a39bb961daedccb08e47cb4cf83b2d4ef72108.zip |
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 <wxiaoguang@gmail.com>
Diffstat (limited to 'services/repository/files')
-rw-r--r-- | services/repository/files/content.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/repository/files/content.go b/services/repository/files/content.go index 6f6dc91d85..c701431d67 100644 --- a/services/repository/files/content.go +++ b/services/repository/files/content.go @@ -203,7 +203,7 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref } else if entry.IsLink() { contentsResponse.Type = string(ContentTypeLink) // The target of a symlink file is the content of the file - targetFromContent, err := entry.Blob().GetBlobContent() + targetFromContent, err := entry.Blob().GetBlobContent(1024) if err != nil { return nil, err } |