# HG changeset patch # User nanaya # Date 1638096848 -32400 # Node ID 02d043b1967d99c0461c7b7dfef45d7af9e33bac # Parent 403f71d22b7b26a43708d6f5f0c61dfbd8020ed7 Accept file upload instead of binary gzip parameter diff -r 403f71d22b7b -r 02d043b1967d README.md --- a/README.md Sun Nov 28 19:45:59 2021 +0900 +++ b/README.md Sun Nov 28 19:54:08 2021 +0900 @@ -30,11 +30,11 @@ Or with gzip to save bandwidth: - ...some commands... | gzip | curl 'https://0paste.com/pastes.txt' -F 'paste[paste_gzip]=<-' + ...some commands... | gzip | curl 'https://0paste.com/pastes.txt' -F 'paste[paste_gzip]=@-' Privately: - ...some commands... | gzip | curl 'https://0paste.com/pastes.txt' -F 'paste[is_private]=1' -F 'paste[paste_gzip]=<-' + ...some commands... | gzip | curl 'https://0paste.com/pastes.txt' -F 'paste[is_private]=1' -F 'paste[paste_gzip]=@-' Design ------ diff -r 403f71d22b7b -r 02d043b1967d app/models/paste.rb --- a/app/models/paste.rb Sun Nov 28 19:45:59 2021 +0900 +++ b/app/models/paste.rb Sun Nov 28 19:54:08 2021 +0900 @@ -36,7 +36,7 @@ end def paste_gzip=(paste) - self.paste = ActiveSupport::Gzip.decompress paste + self.paste = ActiveSupport::Gzip.decompress paste.read end def paste_gzip_base64=(paste)