mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-26 06:05:54 +03:00
[PR #1528] [MERGED] Fill the errors attribute for HTTP errors #1577
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#1577
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/1528
Author: @manuteleco
Created: 3/10/2024
Status: ✅ Merged
Merged: 3/13/2024
Merged by: @fsouza
Base:
main← Head:fill_errors_list_in_response📝 Commits (1)
7f00251Fill theerrorsattribute for HTTP errors📊 Changes
3 files changed (+16 additions, -4 deletions)
View changed files
📝
fakestorage/json_response.go(+13 -1)📝
fakestorage/object_test.go(+1 -1)📝
fakestorage/upload_test.go(+2 -2)📄 Description
Some GCS client libraries (like this one), are quite strict when it comes to the set of attributes they expect to find in the error response. If any of those attributes is missing, they fail to deserialize the error.
In
fake-gcs-server, thehttpError.Errorsattribute was always initialized tonil, causing theerror.errorsJSON response attribute to be omitted and leading to failures in some client libraries.In this commit we address that issue by always providing content on the
errorsattribute (httpError.Errorsfield) whenever we return an error response. The implementation is kept simple without aiming to return exactly the same values that are officially documented. The main goal is to have a sensible response that is structurally correct for the purposes of deserialization client-side.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.