format headers better
This commit is contained in:
11
proxy.cgi
11
proxy.cgi
@@ -17,17 +17,14 @@ def format_output(url, data):
|
|||||||
return template.format(url, data)
|
return template.format(url, data)
|
||||||
|
|
||||||
def print_headers():
|
def print_headers():
|
||||||
print('Content-Type: text/html; charset=utf8')
|
print('Content-Type: text/html; charset=utf8\r\n\r\n')
|
||||||
print()
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
form = cgi.FieldStorage()
|
form = cgi.FieldStorage()
|
||||||
|
|
||||||
if 'u' not in form or len(form['u']) == 0:
|
if 'u' not in form:
|
||||||
print('Status: 400 Bad Request')
|
print('Status: 400 Bad Request\r\n\r\n')
|
||||||
print()
|
print('Missing required field\r\n\r\n')
|
||||||
print('Missing required field')
|
|
||||||
print()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
url = form['u']
|
url = form['u']
|
||||||
|
|||||||
Reference in New Issue
Block a user