[PR #2129] [MERGED] fakestorage: handle X-HTTP-Method-Override header in updateObject #2123

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

📋 Pull Request Information

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

Base: mainHead: fix-X-HTTP-Method-Override


📝 Commits (1)

  • c5740da fakestorage: handle X-HTTP-Method-Override header in updateObject

📊 Changes

3 files changed (+41 additions, -1 deletions)

View changed files

📝 fakestorage/object.go (+4 -0)
📝 fakestorage/object_test.go (+37 -0)
📝 fakestorage/server.go (+0 -1)

📄 Description

The route with Headers("X-HTTP-Method-Override", "PATCH") wasn't matching requests, causing POST requests with the override header to be handled by updateObject instead of patchObject. This resulted in metadata being replaced instead of merged.

Instead of relying on the route matcher, check the header directly in updateObject and delegate to patchObject when present.

Fixes #2036.


🔄 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/2129 **Author:** [@fsouza](https://github.com/fsouza) **Created:** 1/31/2026 **Status:** ✅ Merged **Merged:** 1/31/2026 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `fix-X-HTTP-Method-Override` --- ### 📝 Commits (1) - [`c5740da`](https://github.com/fsouza/fake-gcs-server/commit/c5740da86cc1a61c4d1e727e7dac4f125f025571) fakestorage: handle X-HTTP-Method-Override header in `updateObject` ### 📊 Changes **3 files changed** (+41 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/object.go` (+4 -0) 📝 `fakestorage/object_test.go` (+37 -0) 📝 `fakestorage/server.go` (+0 -1) </details> ### 📄 Description The route with Headers("X-HTTP-Method-Override", "PATCH") wasn't matching requests, causing POST requests with the override header to be handled by `updateObject` instead of `patchObject`. This resulted in metadata being replaced instead of merged. Instead of relying on the route matcher, check the header directly in `updateObject` and delegate to `patchObject` when present. Fixes #2036. --- <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:53 +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#2123
No description provided.