[PR #2114] [MERGED] fix: Preserve content type from resumable upload session metadata #2108

Closed
opened 2026-03-03 13:29:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/2114
Author: @ide
Created: 1/21/2026
Status: Merged
Merged: 1/31/2026
Merged by: @fsouza

Base: mainHead: fix-resumable-upload-content-type


📝 Commits (1)

  • 57e71b1 Preserve content type from resumable upload session metadata

📊 Changes

2 files changed (+199 additions, -1 deletions)

View changed files

📝 fakestorage/upload.go (+1 -1)
📝 fakestorage/upload_test.go (+198 -0)

📄 Description

Why

When uploading files using resumable uploads, the contentType specified in the initial session creation request was being overwritten with application/octet-stream when uploading file content.

Before: session metadata sets contentType: "text/csv" → chunk upload without Content-Type header → object has contentType: "application/octet-stream"

After: session metadata sets contentType: "text/csv" → chunk upload without Content-Type header → object has contentType: "text/csv"

How

Only default to application/octet-stream when no content type was set in either the chunk upload's Content-Type header or the session initialization metadata.

Test Plan

go test ./fakestorage/... -run TestResumableUploadContentType


🔄 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/2114 **Author:** [@ide](https://github.com/ide) **Created:** 1/21/2026 **Status:** ✅ Merged **Merged:** 1/31/2026 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `fix-resumable-upload-content-type` --- ### 📝 Commits (1) - [`57e71b1`](https://github.com/fsouza/fake-gcs-server/commit/57e71b1b2253a7a68ac123faa33529a52d131c68) Preserve content type from resumable upload session metadata ### 📊 Changes **2 files changed** (+199 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/upload.go` (+1 -1) 📝 `fakestorage/upload_test.go` (+198 -0) </details> ### 📄 Description Why === When uploading files using resumable uploads, the `contentType` specified in the initial session creation request was being overwritten with `application/octet-stream` when uploading file content. Before: session metadata sets `contentType: "text/csv"` → chunk upload without Content-Type header → object has `contentType: "application/octet-stream"` After: session metadata sets `contentType: "text/csv"` → chunk upload without Content-Type header → object has `contentType: "text/csv"` How === Only default to `application/octet-stream` when no content type was set in either the chunk upload's Content-Type header or the session initialization metadata. Test Plan === `go test ./fakestorage/... -run TestResumableUploadContentType` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 13:29:49 +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#2108
No description provided.