Skip to content

Conversation

@sahacky
Copy link

@sahacky sahacky commented Nov 28, 2025

Problem

When using Faraday with the Typhoeus adapter, file download requests with specific content encoding types (particularly aws-chunked) were failing with Unrecognized or bad HTTP Content or Transfer-Encoding errors.

The root cause was that accept_encoding: '' explicitly disables encoding handling, which interferes with proper compression and content encoding processing by servers.

Solution

Changed accept_encoding: '' to accept_encoding: nil in the Typhoeus adapter. This allows Typhoeus to use default values and handle compression correctly while maintaining proper server communication.

Testing

✅ All existing tests pass

✅ Rubocop without offenses

✅ Backward compatibility maintained

✅ File downloads with various content encodings now work correctly

✅ Standard gzip/deflate compression handling preserved

- Change accept_encoding from empty string to nil
- Allows Typhoeus to handle compression properly
- Maintains backward compatibility
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