Compare commits
No commits in common. '6039e04724f2f5a1195f0e970b29e7a69ce10d14' and '42de227b70739b80fb8eb18736b92c25e03a546e' have entirely different histories.
6039e04724
...
42de227b70
@ -1,20 +0,0 @@
|
|||||||
# Dev-server-only fix: WEBrick's FileHandler#not_modified? treats a Range
|
|
||||||
# request's If-Range header the same as If-None-Match, replying 304 (no body)
|
|
||||||
# instead of 206 with the requested bytes. Browsers rely on ranged requests
|
|
||||||
# (with If-Range) to fetch a video's trailing moov atom when seeking/loading
|
|
||||||
# metadata, so this breaks video playback under `jekyll serve`.
|
|
||||||
# See https://github.com/ruby/webrick/blob/master/lib/webrick/httpservlet/filehandler.rb
|
|
||||||
#
|
|
||||||
# Upstream bug, not yet fixed as of writing:
|
|
||||||
# https://github.com/ruby/webrick/pull/173 (fix if-range returning 304 instead of 206/200)
|
|
||||||
# https://github.com/ruby/webrick/pull/169 (do not cache range requests)
|
|
||||||
# Drop this plugin once one of those lands in a released webrick version.
|
|
||||||
require 'webrick'
|
|
||||||
|
|
||||||
module WebrickRangeFix
|
|
||||||
def not_modified?(req, res, mtime, etag)
|
|
||||||
req['Range'] ? false : super
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
WEBrick::HTTPServlet::DefaultFileHandler.prepend(WebrickRangeFix)
|
|
||||||
Loading…
Reference in New Issue