blob: 01bb3309b103d5bba772bdbf1d0d0b8bc28c8e99 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import time
def main(request, response):
delay_before_header = float(request.GET.first(b"delayBeforeHeader", 0)) / 1000
delay_before_body = float(request.GET.first(b"delayBeforeBody", 0)) / 1000
time.sleep(delay_before_header)
if b"cors" in request.GET:
response.headers.set(b"Access-Control-Allow-Origin", b"*")
response.write_status_headers()
time.sleep(delay_before_body)
response.writer.write_content(b"Body")
|