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](22a42936-4cf8-40b4-a5c7-e384082beb0d)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
yp05327 2023-06-13 18:02:25 +09:00 committed by GitHub
parent a583c56306
commit 22a39bb961
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 116 additions and 12 deletions

View file

@ -88,7 +88,7 @@ func testPackageCargo(t *testing.T, _ *neturl.URL) {
blob, err := commit.GetBlobByPath(path)
assert.NoError(t, err)
content, err := blob.GetBlobContent()
content, err := blob.GetBlobContent(1024)
assert.NoError(t, err)
return content