You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from google-apis-core 0.18.0 (httpclient) to 1.0.2 (faraday), binary file downloads via download_dest receive raw gzip-compressed bytes instead of the decompressed file content. The old httpclient backend handled this transparently via transparent_gzip_decompression.
download_dest should receive the decompressed file content — the actual XLSX/ZIP binary data with magic bytes PK\x03\x04 (504b0304).
This was the behavior with google-apis-core 0.18.0 using httpclient, which had transparent_gzip_decompression enabled by default.
Actual behavior
download_dest receives raw gzip-compressed bytes (magic bytes \x1F\x8B / 1f8b0800). The content is not decompressed before being written to the IO/file.
This breaks any downstream code that expects the actual file content (e.g., parsing XLSX files with rubyzip or roo):
Zip::Error: Zip end of central directory signature not found
Additional context
Affects all download_dest targets: StringIO, Tempfile (binmode), and file path strings all receive gzip-compressed content.
Does not affect export_file: Text exports (CSV, etc.) via export_file work correctly.
Environment details
Summary
After upgrading from
google-apis-core0.18.0 (httpclient) to 1.0.2 (faraday), binary file downloads viadownload_destreceive raw gzip-compressed bytes instead of the decompressed file content. The old httpclient backend handled this transparently viatransparent_gzip_decompression.Steps to reproduce
```ruby
require "google/apis/drive_v3"
require "stringio"
client = Google::Apis::DriveV3::DriveService.new
client.authorization = Google::Auth.get_application_default(["https://www.googleapis.com/auth/drive"])
Download a binary file (e.g., .xlsx) from Google Drive
io = client.get_file("SOME_FILE_ID", download_dest: StringIO.new)
io.rewind
bytes = io.string
puts bytes.encoding #=> UTF-8
puts bytes[0..3].unpack1('H*') #=> "1f8b0800" (gzip magic number)
Expected: "504b0304" (ZIP/XLSX magic number)
```
Expected behavior
download_destshould receive the decompressed file content — the actual XLSX/ZIP binary data with magic bytesPK\x03\x04(504b0304).This was the behavior with
google-apis-core0.18.0 using httpclient, which hadtransparent_gzip_decompressionenabled by default.Actual behavior
download_destreceives raw gzip-compressed bytes (magic bytes\x1F\x8B/1f8b0800). The content is not decompressed before being written to the IO/file.This breaks any downstream code that expects the actual file content (e.g., parsing XLSX files with
rubyziporroo):Additional context
download_desttargets: StringIO, Tempfile (binmode), and file path strings all receive gzip-compressed content.export_file: Text exports (CSV, etc.) viaexport_filework correctly.transparent_gzip_decompressionoption was deprecated in the Faraday migration (PR feat!: Replace underlying httpclient library with Faraday #23524), but no equivalent decompression was added fordownload_dest.google-apis-coreto< 1.0to continue using the httpclient backend.Versions
google-apis-coregoogle-apis-drive_v3Related: PR #23524 (httpclient → faraday migration)