mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[PR #2126] [MERGED] Validate destination bucket exists in rewriteObject operation #2119
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#2119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fsouza/fake-gcs-server/pull/2126
Author: @fsouza
Created: 1/30/2026
Status: ✅ Merged
Merged: 1/31/2026
Merged by: @fsouza
Base:
main← Head:claude/fix-issue-2124-hx2Xq📝 Commits (2)
c73f9c6fix: copy to non-existent bucket should return 404cf908d2remove redundant comments from test📊 Changes
2 files changed (+49 additions, -0 deletions)
View changed files
📝
fakestorage/object.go(+3 -0)📝
fakestorage/object_test.go(+46 -0)📄 Description
Summary
Add validation to the
rewriteObjectendpoint to ensure the destination bucket exists before attempting to copy an object. This prevents implicit bucket creation and aligns with expected GCS behavior.Changes
rewriteObjectmethod that returns HTTP 404 if the destination bucket doesn't existTestServiceClientRewriteObjectNonExistentDestBuckettest to verify that:Implementation Details
The validation is performed early in the
rewriteObjectflow by callings.backend.GetBucket(dstBucket)and returning a 404 status if the bucket is not found. This ensures consistent behavior with the actual Google Cloud Storage API.https://claude.ai/code/session_01GRpAvWhUWNbc9aZYS3ZdSP
Closes #2124.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.