mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Better fix for safari video bug
This seems to work everywhere that I've tested.
This commit is contained in:
parent
81f2ee7815
commit
6c11f943d0
1 changed files with 2 additions and 2 deletions
|
@ -149,14 +149,14 @@ private def multipart(file, env : HTTP::Server::Context)
|
||||||
end
|
end
|
||||||
|
|
||||||
if endb == 0
|
if endb == 0
|
||||||
endb = fileb
|
endb = fileb - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if startb < endb && endb <= fileb
|
if startb < endb && endb <= fileb
|
||||||
env.response.status_code = 206
|
env.response.status_code = 206
|
||||||
env.response.content_length = endb - startb
|
env.response.content_length = endb - startb
|
||||||
env.response.headers["Accept-Ranges"] = "bytes"
|
env.response.headers["Accept-Ranges"] = "bytes"
|
||||||
env.response.headers["Content-Range"] = "bytes #{startb}-#{endb > 1 ? endb - 1 : 1}/#{fileb}" # MUST
|
env.response.headers["Content-Range"] = "bytes #{startb}-#{endb}/#{fileb}" # MUST
|
||||||
|
|
||||||
if startb > 1024
|
if startb > 1024
|
||||||
skipped = 0
|
skipped = 0
|
||||||
|
|
Loading…
Reference in a new issue