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

Error: application/octet-stream is not supported #82

Open
richierg opened this issue Oct 17, 2024 · 2 comments
Open

Error: application/octet-stream is not supported #82

richierg opened this issue Oct 17, 2024 · 2 comments

Comments

@richierg
Copy link

Describe the bug
Get error Error: application/octet-stream is not supported when trying to convert url to gif with command like:
https://asciinema.mydomain.com/a/MUmPbyFMlDiGTjzT8wVjeClcm output.gif
This seems to be related to S3 storage usage.

To Reproduce
Steps to reproduce the behavior:

  1. Configure your asciinema server to store data to S3
  2. Upload a cast
  3. Convert the cast from the generated url to GIF with agg
  4. See error

Expected behavior
The gif should be generated

Versions:

  • OS: macOS 14.7 && Ubuntu 22.04
  • agg: 1.4.3

Additional context
I disable S3 storage, and use local one -> works like a charm.
So the download from storage on S3 could be a lead.

@ku1ik
Copy link
Contributor

ku1ik commented Oct 17, 2024

Thanks for the detailed report. I'll try to get to the bottom of it.

@hydezhao
Copy link

It works by authorizing application/octet-stream in conditions, but I am not sure if it is the good method.

diff --git a/src/main.rs b/src/main.rs
index 1c6d503..b21e9fa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -120,7 +120,7 @@ fn download(url: &str) -> Result<impl io::Read> {
         .get(url)
         .header(
             header::ACCEPT,
-            header::HeaderValue::from_static("application/x-asciicast,application/json"),
+            header::HeaderValue::from_static("application/x-asciicast,application/json,application/octet-stream"),
         )
         .build()?;
 
@@ -132,7 +132,7 @@ fn download(url: &str) -> Result<impl io::Read> {
         .and_then(|hv| hv.to_str().ok())
         .ok_or_else(|| anyhow!("unknown content type".to_owned()))?;
 
-    if ct != "application/x-asciicast" && ct != "application/json" {
+    if ct != "application/x-asciicast" && ct != "application/json" && ct != "application/octet-stream" {
         return Err(anyhow!(format!("{ct} is not supported")));
     }

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

No branches or pull requests

3 participants