mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-15 19:28:00 +01:00
Revert "Gzip data for upload"
This reverts commit f54b0a9793.
gzip.NewReader constructs a decompressor, and we need compressor here.
This commit is contained in:
11
api/api.go
11
api/api.go
@@ -2,7 +2,6 @@ package api
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -75,8 +74,7 @@ func (a *AsciinemaAPI) urlForUpload() string {
|
||||
|
||||
func (a *AsciinemaAPI) headersForUpload() map[string]string {
|
||||
return map[string]string{
|
||||
"User-Agent": fmt.Sprintf("asciinema/%s %s/%s %s-%s", a.version, runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH),
|
||||
"Content-Encoding": "gzip",
|
||||
"User-Agent": fmt.Sprintf("asciinema/%s %s/%s %s-%s", a.version, runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,12 +84,7 @@ func filesForUpload(path string) (map[string]io.ReadCloser, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
zippedFile, err := gzip.NewReader(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return map[string]io.ReadCloser{"asciicast:asciicast.json": zippedFile}, nil
|
||||
return map[string]io.ReadCloser{"asciicast:asciicast.json": file}, nil
|
||||
}
|
||||
|
||||
func extractWarningMessage(response *http.Response) string {
|
||||
|
||||
Reference in New Issue
Block a user