Skip to content

Fix GZip decompression when server transparently decompresses .gz files#1546

Open
alinpahontu2912 wants to merge 1 commit intodotnet:mainfrom
alinpahontu2912:fix_gzip
Open

Fix GZip decompression when server transparently decompresses .gz files#1546
alinpahontu2912 wants to merge 1 commit intodotnet:mainfrom
alinpahontu2912:fix_gzip

Conversation

@alinpahontu2912
Copy link
Member

Check for GZIP magic bytes (0x1F, 0x8B) before attempting decompression. If the file is not actually gzip-compressed (e.g., the HTTP server or CDN transparently decompressed it during transfer), copy it as-is instead of throwing a GZipException.

Fixes TestMNISTDownload failure:
GZipException: Error GZIP header, first magic byte doesn't match

Check for GZIP magic bytes (0x1F, 0x8B) before attempting decompression.
If the file is not actually gzip-compressed (e.g., the HTTP server or CDN
transparently decompressed it during transfer), copy it as-is instead of
throwing a GZipException.

Fixes TestMNISTDownload failure:
  GZipException: Error GZIP header, first magic byte doesn't match

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant