blob: d29e7c158a2a69f325ee534d5a90a9316ac0b19b [file] [log] [blame]
#!/usr/bin/env python3
import os
import sys
from urllib.parse import parse_qs
location = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True).get('location', [''])[0]
sys.stdout.write(
'status: 301\r\n'
'Location: {}\r\n'
'Content-Type: text/html\r\n\r\n'.format(location)
)