Example #1
0
def main(request, response):
    subresource.respond(request,
                        response,
                        payload_generator=generate_payload,
                        access_control_allow_origin=b"*",
                        content_type=b"application/json",
                        cache_control=b"no-store")
Example #2
0
def main(request, response):
    handler = lambda data: generate_payload(request, data)
    subresource.respond(request,
                        response,
                        payload_generator=handler,
                        access_control_allow_origin=b"*",
                        content_type=b"video/ogg")
Example #3
0
def main(request, response):
    handler = lambda data: generate_payload(request, data)
    subresource.respond(request,
                        response,
                        payload_generator = handler,
                        access_control_allow_origin = "*",
                        content_type = "video/ogg")
Example #4
0
def main(request, response):
    payload_generator = lambda data: generate_payload(request, data)
    if "import-rule" in request.GET:
        payload_generator = lambda data: generate_import_rule(request, data)

    subresource.respond(
        request,
        response,
        payload_generator=payload_generator,
        content_type="text/css",
        maybe_additional_headers={"Referrer-Policy": "unsafe-url"})
Example #5
0
def main(request, response):
    payload_generator = lambda data: generate_payload(request, data)
    if "import-rule" in request.GET:
        payload_generator = lambda data: generate_import_rule(request, data)

    subresource.respond(
        request,
        response,
        payload_generator = payload_generator,
        content_type = "text/css",
        maybe_additional_headers = { "Referrer-Policy": "unsafe-url" })
def main(request, response):
    handler = lambda data: generate_payload(request, data)
    content_type = 'application/x-font-truetype'

    if "report-headers" in request.GET:
        handler = lambda data: generate_report_headers_payload(request, data)
        content_type = 'application/json'

    subresource.respond(request,
                        response,
                        payload_generator=handler,
                        content_type=content_type,
                        access_control_allow_origin="*")
Example #7
0
def main(request, response):
    handler = lambda data: generate_payload(request, data)
    content_type = 'application/x-font-truetype'

    if "report-headers" in request.GET:
        handler = lambda data: generate_report_headers_payload(request, data)
        content_type = 'application/json'

    subresource.respond(request,
                        response,
                        payload_generator = handler,
                        content_type = content_type,
                        access_control_allow_origin = "*")
Example #8
0
def main(request, response):
    handler = lambda data: generate_payload(request, data)
    content_type = 'image/svg+xml'

    if "embedded-svg" in request.GET:
        handler = lambda data: generate_payload_embedded(request, data)

    if "report-headers" in request.GET:
        handler = lambda data: generate_report_headers_payload(request, data)
        content_type = 'application/json'

    subresource.respond(request,
                        response,
                        payload_generator = handler,
                        content_type = content_type)
Example #9
0
def main(request, response):
    handler = lambda data: generate_payload(request, data)
    content_type = b'image/svg+xml'

    if b"embedded-svg" in request.GET:
        handler = lambda data: generate_payload_embedded(request, data)

    if b"report-headers" in request.GET:
        handler = lambda data: generate_report_headers_payload(request, data)
        content_type = b'application/json'

    subresource.respond(request,
                        response,
                        payload_generator=handler,
                        content_type=content_type)
Example #10
0
def main(request, response):
    payload_generator = lambda data: generate_payload(request, data)
    content_type = "text/css"
    referrer_policy = "unsafe-url"
    if "import-rule" in request.GET:
        payload_generator = lambda data: generate_import_rule(request, data)

    if "report-headers" in request.GET:
        payload_generator = lambda data: generate_report_headers_payload(request, data)
        content_type = 'application/json'

    if "referrer-policy" in request.GET:
        referrer_policy = request.GET["referrer-policy"]

    subresource.respond(
        request,
        response,
        payload_generator = payload_generator,
        content_type = content_type,
        maybe_additional_headers = { "Referrer-Policy": referrer_policy })
Example #11
0
def main(request, response):
    payload_generator = lambda data: generate_payload(request, data)
    content_type = "text/css"
    referrer_policy = "unsafe-url"
    if "import-rule" in request.GET:
        payload_generator = lambda data: generate_import_rule(request, data)

    if "report-headers" in request.GET:
        payload_generator = lambda data: generate_report_headers_payload(
            request, data)
        content_type = 'application/json'

    if "referrer-policy" in request.GET:
        referrer_policy = request.GET["referrer-policy"]

    subresource.respond(
        request,
        response,
        payload_generator=payload_generator,
        content_type=content_type,
        maybe_additional_headers={"Referrer-Policy": referrer_policy})
Example #12
0
def main(request, response):
    subresource.respond(request,
                        response,
                        payload_generator=generate_payload,
                        access_control_allow_origin="*",
                        content_type="text/plain")
Example #13
0
def main(request, response):
    payload_generator = lambda _: generate_payload(request)
    subresource.respond(request,
                        response,
                        payload_generator=payload_generator,
                        content_type="application/javascript")
Example #14
0
File: image.py Project: 0X1A/servo
def main(request, response):
    subresource.respond(request,
                        response,
                        payload_generator = generate_payload,
                        content_type = "image/bmp",
                        access_control_allow_origin = "*")
Example #15
0
def main(request, response):
    subresource.respond(request, response, payload_generator=generate_payload)
Example #16
0
def main(request, response):
    subresource.respond(request,
                        response,
                        payload_generator=generate_payload,
                        content_type="image/png",
                        access_control_allow_origin="*")
Example #17
0
def main(request, response):
    subresource.respond(request, response, payload_generator=generate_payload)
Example #18
0
def main(request, response):
    subresource.respond(request,
                        response,
                        payload_generator = generate_payload,
                        content_type = "application/javascript")
Example #19
0
def main(request, response):
    subresource.respond(request,
                        response,
                        payload_generator=generate_payload,
                        content_type="application/javascript")
Example #20
0
def main(request, response):
    subresource.respond(request,
                        response,
                        payload_generator = generate_payload,
                        access_control_allow_origin = "*",
                        content_type = "text/plain")