change etag

This commit is contained in:
YouROK
2022-05-25 20:52:06 +03:00
parent 5800c01cb0
commit 74ff44d5a3
2 changed files with 4 additions and 2 deletions

View File

@@ -62,7 +62,8 @@ func (t *Torrent) Stream(fileID int, req *http.Request, resp http.ResponseWriter
sets.SetViewed(&sets.Viewed{t.Hash().HexString(), fileID})
resp.Header().Set("Connection", "close")
resp.Header().Set("ETag", httptoo.EncodeQuotedString(fmt.Sprintf("%s/%s", t.Hash().HexString(), hex.EncodeToString([]byte(file.Path())))))
etag := hex.EncodeToString([]byte(fmt.Sprintf("%s/%s", t.Hash().HexString(), file.Path())))
resp.Header().Set("ETag", httptoo.EncodeQuotedString(etag))
// DLNA headers
resp.Header().Set("transferMode.dlna.org", "Streaming")
mime, err := mt.MimeTypeByPath(file.Path())