Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not gzip assets that are already gzipped #57

Merged
merged 1 commit into from
Jun 26, 2015

Conversation

byroot
Copy link
Member

@byroot byroot commented May 29, 2015

I know it's not really the vanilla use case for sprockets, but we were using it to serve a few tar.gz archives.

Turns out sprockets would gzip them a second time :/

@josh do you think that fix make sense? I can also take a look at the 3.x branch to see if it's also affected.

cc @ryanbalsdon for discovering the bug.

@rafaelfranca
Copy link
Member

@byroot sprockets 3 don't gzip the assets anymore, so it will only affect 2.x.

@byroot
Copy link
Member Author

byroot commented May 29, 2015

Awesome!

@@ -139,7 +139,9 @@ def stale?(environment)
# Save asset to disk.
def write_to(filename, options = {})
# Gzip contents if filename has '.gz'
options[:compress] ||= File.extname(filename) == '.gz'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way I think there was a bug here. You couldn't pass compress: false

@rafaelfranca
Copy link
Member

I had this same bug before, so I think it makes sense.

rafaelfranca added a commit that referenced this pull request Jun 26, 2015
Do not gzip assets that are already gzipped
@rafaelfranca rafaelfranca merged commit 4cc0d15 into rails:2.x Jun 26, 2015
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.

2 participants