[PR #851] [CLOSED] Add support for gzip transcoding #974

Closed
opened 2026-03-03 12:32:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/851
Author: @ekimekim
Created: 7/8/2022
Status: Closed

Base: mainHead: gzip-transcoding


📝 Commits (2)

  • 1c610ea Correctly set ContentType and ContentEncoding for resumable uploads
  • 8799771 Add support for gzip transcoding

📊 Changes

2 files changed (+33 additions, -7 deletions)

View changed files

📝 fakestorage/object.go (+29 -7)
📝 fakestorage/upload.go (+4 -0)

📄 Description

When an object has Content-Encoding: gzip, and an object download request does not have Accept-Encoding: gzip, GCS will decompress the object before serving it. This is documented here: https://cloud.google.com/storage/docs/transcoding

I've added support for this alongside the current range request logic (it's related - if we are transcoding, we ignore the range header).

To make this work for our use-case I also had to fix a bug in resumable uploads where content encoding metadata was not being set if it was specified in the request body.

EDIT: I just noticed https://github.com/fsouza/fake-gcs-server/issues/532, I believe this PR fixes that as well.


🔄 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/851 **Author:** [@ekimekim](https://github.com/ekimekim) **Created:** 7/8/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `gzip-transcoding` --- ### 📝 Commits (2) - [`1c610ea`](https://github.com/fsouza/fake-gcs-server/commit/1c610eabd4bbb53f88d8428aa4a546402b5997e7) Correctly set ContentType and ContentEncoding for resumable uploads - [`8799771`](https://github.com/fsouza/fake-gcs-server/commit/87997717412e176826396fdb559544010acad179) Add support for gzip transcoding ### 📊 Changes **2 files changed** (+33 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/object.go` (+29 -7) 📝 `fakestorage/upload.go` (+4 -0) </details> ### 📄 Description When an object has Content-Encoding: gzip, and an object download request does not have Accept-Encoding: gzip, GCS will decompress the object before serving it. This is documented here: https://cloud.google.com/storage/docs/transcoding I've added support for this alongside the current range request logic (it's related - if we are transcoding, we ignore the range header). To make this work for our use-case I also had to fix a bug in resumable uploads where content encoding metadata was not being set if it was specified in the request body. EDIT: I just noticed https://github.com/fsouza/fake-gcs-server/issues/532, I believe this PR fixes that as well. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:32:29 +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#974
No description provided.