[PR #146] [MERGED] Gzip data for upload #392

Closed
opened 2026-02-25 20:33:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/146
Author: @bentranter
Created: 2/12/2016
Status: Merged
Merged: 2/13/2016
Merged by: @ku1ik

Base: masterHead: gzip-data-for-upload


📝 Commits (1)

📊 Changes

1 file changed (+9 additions, -2 deletions)

View changed files

📝 api/api.go (+9 -2)

📄 Description

Relevant issue: asciinema/discussions#12

This tiny PR gzips the body of the POST request before uploading it, and adds the appropriate Accept-Encoding header to the request. As far as I can tell, no change needs to be made on the Rails end, since Net::HTTP knows to automatically decompress gzipped requests if they contain the Accept-Encoding: gzip header.

I tested this by compiling locally and uploading an asciicast and it seemed to work, but if there's more I should do to ensure this is okay, let me know.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asciinema/asciinema/pull/146 **Author:** [@bentranter](https://github.com/bentranter) **Created:** 2/12/2016 **Status:** ✅ Merged **Merged:** 2/13/2016 **Merged by:** [@ku1ik](https://github.com/ku1ik) **Base:** `master` ← **Head:** `gzip-data-for-upload` --- ### 📝 Commits (1) - [`f54b0a9`](https://github.com/asciinema/asciinema/commit/f54b0a979360900c86f331538f49706cf737416a) Gzip data for upload ### 📊 Changes **1 file changed** (+9 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `api/api.go` (+9 -2) </details> ### 📄 Description Relevant issue: asciinema/discussions#12 This tiny PR gzips the body of the POST request before uploading it, and adds the appropriate `Accept-Encoding` header to the request. As far as I can tell, no change needs to be made on the Rails end, since `Net::HTTP` knows to automatically decompress gzipped requests if they contain the `Accept-Encoding: gzip` header. I tested this by compiling locally and uploading [an asciicast](https://asciinema.org/a/5a4ro8drmyekusbrzbrt3n5ur) and it seemed to work, but if there's more I should do to ensure this is okay, let me know. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 20:33:35 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#392
No description provided.