This commit is contained in:
YouROK
2020-12-08 17:08:33 +03:00
parent e4b9fea084
commit 442c1fc27a

View File

@@ -24,7 +24,8 @@ func (t *Torrent) Stream(fileIndex int, req *http.Request, resp http.ResponseWri
sets.SetViewed(&sets.Viewed{t.Hash().HexString(), fileIndex}) sets.SetViewed(&sets.Viewed{t.Hash().HexString(), fileIndex})
resp.Header().Set("Connection", "close") //TODO проверить почему плеер постоянно переподключается
resp.Header().Set("Connection", "keep-alive")
resp.Header().Set("ETag", httptoo.EncodeQuotedString(fmt.Sprintf("%s/%s", t.Hash().HexString(), file.Path()))) resp.Header().Set("ETag", httptoo.EncodeQuotedString(fmt.Sprintf("%s/%s", t.Hash().HexString(), file.Path())))
http.ServeContent(resp, req, file.Path(), time.Time{}, reader) http.ServeContent(resp, req, file.Path(), time.Time{}, reader)