[PR #1042] [MERGED] supportsuccess_action_status form field for HTML form uploads #1138

Closed
opened 2026-03-03 12:33:14 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/1042
Author: @vincentezw
Created: 1/11/2023
Status: Merged
Merged: 1/12/2023
Merged by: @fsouza

Base: mainHead: main


📝 Commits (3)

  • c16e90a check for success_action_status form field
  • aedb2ae return xml on 201, PR feedback
  • 958810d struct instead of interface

📊 Changes

3 files changed (+62 additions, -5 deletions)

View changed files

📝 fakestorage/upload.go (+18 -1)
📝 fakestorage/upload_test.go (+11 -3)
📝 fakestorage/xml_response.go (+33 -1)

📄 Description

When uploading an object with a HTML form, the GCS XML api allows us to set a success_action_status: Upload an object with a HTML form

The status code that you want Cloud Storage to respond with when an upload is successful. The default is 204, but you can change this to 200 or 201

Presently fake-gcs-server ignores this and responds with the default status code 204 (https://github.com/fsouza/fake-gcs-server/blob/main/fakestorage/upload.go#L162)

This PR allows us to specify a preferred return value of 200, 201 or 204.


🔄 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/1042 **Author:** [@vincentezw](https://github.com/vincentezw) **Created:** 1/11/2023 **Status:** ✅ Merged **Merged:** 1/12/2023 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`c16e90a`](https://github.com/fsouza/fake-gcs-server/commit/c16e90a7f3001d0f8d66ca466cb6259c03d409b8) check for success_action_status form field - [`aedb2ae`](https://github.com/fsouza/fake-gcs-server/commit/aedb2ae47bb88e9f765b732fa6355f1ecc6366d8) return xml on 201, PR feedback - [`958810d`](https://github.com/fsouza/fake-gcs-server/commit/958810d9eff450f42ed6cd90570d963bbffd6102) struct instead of interface ### 📊 Changes **3 files changed** (+62 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/upload.go` (+18 -1) 📝 `fakestorage/upload_test.go` (+11 -3) 📝 `fakestorage/xml_response.go` (+33 -1) </details> ### 📄 Description When uploading an object with a HTML form, the GCS XML api allows us to set a `success_action_status`: [Upload an object with a HTML form](https://cloud.google.com/storage/docs/xml-api/post-object-forms#:~:text=No-,success_action_status,-The%20status%20code) > The status code that you want Cloud Storage to respond with when an upload is successful. The default is 204, but you can change this to 200 or 201 Presently `fake-gcs-server` ignores this and responds with the default status code 204 (https://github.com/fsouza/fake-gcs-server/blob/main/fakestorage/upload.go#L162) This PR allows us to specify a preferred return value of 200, 201 or 204. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:33:14 +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#1138
No description provided.