summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/mozilla/tests/service-workers/resources/fetch_video.py
blob: 541f00c019814b369e4a5aed989730ee990381ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import os


def main(request, response):
    filename = os.path.join(request.doc_root, u"media", u"2x2-green.ogv")
    body = open(filename, "rb").read()
    length = len(body)
    headers = [
        (b"Content-Type", b"video/ogg"),
        (b"Accept-Ranges", b"bytes"),
        (b"Content-Length", b"%d" % length),
        (b"Content-Range", b"bytes 0-%d/%d" % (length - 1, length)),
    ]
    return headers, body