mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 03:38:03 +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 (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"compress/gzip"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@@ -75,8 +74,7 @@ func (a *AsciinemaAPI) urlForUpload() string {
|
|||||||
|
|
||||||
func (a *AsciinemaAPI) headersForUpload() map[string]string {
|
func (a *AsciinemaAPI) headersForUpload() map[string]string {
|
||||||
return 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),
|
"User-Agent": fmt.Sprintf("asciinema/%s %s/%s %s-%s", a.version, runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH),
|
||||||
"Content-Encoding": "gzip",
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,12 +84,7 @@ func filesForUpload(path string) (map[string]io.ReadCloser, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
zippedFile, err := gzip.NewReader(file)
|
return map[string]io.ReadCloser{"asciicast:asciicast.json": file}, nil
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return map[string]io.ReadCloser{"asciicast:asciicast.json": zippedFile}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func extractWarningMessage(response *http.Response) string {
|
func extractWarningMessage(response *http.Response) string {
|
||||||
|
|||||||
Reference in New Issue
Block a user