diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-07-19 02:14:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 18:14:47 +0000 |
commit | 236c645bf16754ca9294545e71014a01a24ccfd8 (patch) | |
tree | 4ca9d8f93aca854d841a7379955e9653a8212546 /tests/integration/api_repo_file_update_test.go | |
parent | 265a28802a6062d86964c9bfe1959437eaf69afb (diff) | |
download | gitea-236c645bf16754ca9294545e71014a01a24ccfd8.tar.gz gitea-236c645bf16754ca9294545e71014a01a24ccfd8.zip |
Refactor "Content" for file uploading (#25851)
Before: the concept "Content string" is used everywhere. It has some
problems:
1. Sometimes it means "base64 encoded content", sometimes it means "raw
binary content"
2. It doesn't work with large files, eg: uploading a 1G LFS file would
make Gitea process OOM
This PR does the refactoring: use "ContentReader" / "ContentBase64"
instead of "Content"
This PR is not breaking because the key in API JSON is still "content":
`` ContentBase64 string `json:"content"` ``
Diffstat (limited to 'tests/integration/api_repo_file_update_test.go')
-rw-r--r-- | tests/integration/api_repo_file_update_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/integration/api_repo_file_update_test.go b/tests/integration/api_repo_file_update_test.go index 5bcb531fc1..9a29ccbf5e 100644 --- a/tests/integration/api_repo_file_update_test.go +++ b/tests/integration/api_repo_file_update_test.go @@ -44,7 +44,7 @@ func getUpdateFileOptions() *api.UpdateFileOptions { }, SHA: "103ff9234cefeee5ec5361d22b49fbb04d385885", }, - Content: contentEncoded, + ContentBase64: contentEncoded, } } |