[PR #694] [MERGED] Write to byte buffer first, then to response #833

Closed
opened 2026-03-03 12:31:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/694
Author: @m4gus88
Created: 2/24/2022
Status: Merged
Merged: 2/25/2022
Merged by: @fsouza

Base: mainHead: batch-fix


📝 Commits (3)

📊 Changes

1 file changed (+13 additions, -2 deletions)

View changed files

📝 fakestorage/server.go (+13 -2)

📄 Description

I've ran into an issue where parts of the request could not be read, because the response writer was already close, as we were already writing stuff into it before.
The solution is to write into a byte buffer instead, and write that out in the end into the response.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fsouza/fake-gcs-server/pull/694 **Author:** [@m4gus88](https://github.com/m4gus88) **Created:** 2/24/2022 **Status:** ✅ Merged **Merged:** 2/25/2022 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `batch-fix` --- ### 📝 Commits (3) - [`f121c6c`](https://github.com/fsouza/fake-gcs-server/commit/f121c6c7758d965028bf863ec03cdf57ff8c30ea) Write to byte buffer first, then to response - [`0e0f687`](https://github.com/fsouza/fake-gcs-server/commit/0e0f687a8f90041df1dc63103de37cc0d72433a4) Fix golint - [`202880c`](https://github.com/fsouza/fake-gcs-server/commit/202880c6c4a1c90de7bb9dd6f3cbb5ba63f6d4ac) Another lint fix ### 📊 Changes **1 file changed** (+13 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/server.go` (+13 -2) </details> ### 📄 Description I've ran into an issue where parts of the request could not be read, because the response writer was already close, as we were already writing stuff into it before. The solution is to write into a byte buffer instead, and write that out in the end into the response. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:31:50 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#833
No description provided.