forgot to delete those println xd
All checks were successful
CI / build (push) Successful in 1m1s

This commit is contained in:
Fijxu 2025-03-28 23:47:32 -03:00
parent 71aa6edd67
commit a9c845651d
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -183,12 +183,10 @@ func Videoplayback(w http.ResponseWriter, req *http.Request) {
// "bytes=500-1000" get 500 bytes starting from 500 // "bytes=500-1000" get 500 bytes starting from 500
byteParts := strings.Split(requestBytes, "-") byteParts := strings.Split(requestBytes, "-")
firstByte, lastByte := byteParts[0], byteParts[1] firstByte, lastByte := byteParts[0], byteParts[1]
fmt.Println(byteParts)
if lastByte != "" { if lastByte != "" {
w.Header().Add("content-range", "bytes "+requestBytes+"/*") w.Header().Add("content-range", "bytes "+requestBytes+"/*")
w.WriteHeader(206) w.WriteHeader(206)
} else { } else {
fmt.Println("nolastbyte")
// i.e. "bytes=0-", "bytes=600-" // i.e. "bytes=0-", "bytes=600-"
// full size of content is able to be calculated, so a full Content-Range header can be constructed // full size of content is able to be calculated, so a full Content-Range header can be constructed
bytesReceived := resp.Header.Get("content-length") bytesReceived := resp.Header.Get("content-length")