-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix profile render when the README.md size is larger than 1024 bytes #25131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think we should instead add a |
Yes, that function should be changed, at least the name. |
Are we certain we can change the previous use cases from 1024 to 0? I imagine this might have been done for performance reasons in cases where the exact content was not needed. |
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should investigate closer what this does, but does not have to be in this PR. It might be that this is another undiscovered bug and it should actually use 0
here.
6d950bf
to
b1ad006
Compare
b1ad006
to
0e2e0d8
Compare
I was unable to create a backport for 1.20. @yp05327, please send one manually. 🍵
|
* upstream/main: (31 commits) Show OAuth2 errors to end users (go-gitea#25261) [skip ci] Updated translations via Crowdin Fix index generation parallelly failure (go-gitea#25235) Fix variable in template (go-gitea#25267) Add template linting via djlint (go-gitea#25212) Fix edit OAuth application width (go-gitea#25262) Use flex to align SVG and text (go-gitea#25163) GitHub Actions enhancements for frontend (go-gitea#25150) Add missing `v` in migrations.go (go-gitea#25252) Change form actions to fetch for submit review box (go-gitea#25219) Fix panic when migrating a repo from GitHub with issues (go-gitea#25246) Fix description of drop custom_labels migration (go-gitea#25243) Fix all possible setting error related storages and added some tests (go-gitea#23911) [skip ci] Updated translations via Crowdin Revert overflow: overlay (revert go-gitea#21850) (go-gitea#25231) Support changing labels of Actions runner without re-registration (go-gitea#24806) Improve AJAX link and modal confirm dialog (go-gitea#25210) Use inline SVG for built-in OAuth providers (go-gitea#25171) Disable `Create column` button while the column name is empty (go-gitea#25192) Fix profile render when the README.md size is larger than 1024 bytes (go-gitea#25131) ...
Fixes #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:
