server: set Content-Length for tarballs
This commit is contained in:
parent
3f892331f6
commit
f02730dc6b
1 changed files with 3 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"regexp"
|
||||
|
|
@ -171,6 +172,8 @@ func handleArtistAlbumPage(w http.ResponseWriter, req *http.Request) {
|
|||
}
|
||||
w.Header().Set("Content-Disposition", `attachment; filename="` +
|
||||
strings.ReplaceAll(album.Name, `"`, `'`) + `.tar.gz"`)
|
||||
w.Header().Set("Content-Length",
|
||||
fmt.Sprintf("%d", album.TarballSize))
|
||||
w.Write(contents)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue