예제 #1
0
 def site(req):
     p = getparam(req)
     html = (u'<html>%s</html>' % cgi.escape(p)).encode('utf-8')
     header_bytes = b'\r\n'.join([
         b'Content-Type: text/html; charset=utf-8',
         b'Set-Cookie: url=' + encode(p)
     ])
     headers = parse_http_headers(header_bytes)
     return (200, html, headers)
예제 #2
0
 def site(req):
     p = getparam(req)
     html = (u'<html>%s</html>' % cgi.escape(p)).encode('utf-8')
     header_bytes = b'\r\n'.join([
         b'Content-Type: text/html; charset=utf-8',
         b'Set-Cookie: url=' + encode(p)
     ])
     headers = parse_http_headers(header_bytes)
     return (200, html, headers)
예제 #3
0
 def site(req):
     p = getparam(req)
     if p is None:
         p = ""
     html = (u'<html>%s</html>' % cgi.escape(p)).encode('utf-8')
     header_bytes = b'\r\n'.join([
         b'Content-Type: text/html; charset=utf-8',
         b'Set-Cookie: url=' + encode(p)
     ])
     headers = parse_http_headers(header_bytes)
     parsed_headers = {}
     for value, key in headers.items():
         parsed_headers[value] = key
     return (200, html, parsed_headers)
예제 #4
0
 def site(req):
     p = getparam(req)
     if p is None:
         p = ""
     html = (u'<html>%s</html>' % cgi.escape(p)).encode('utf-8')
     header_bytes = b'\r\n'.join([
         b'Content-Type: text/html; charset=utf-8',
         b'Set-Cookie: url=' + encode(p)
     ])
     headers = parse_http_headers(header_bytes)
     parsed_headers = {}
     for value, key in headers.items():
         parsed_headers[value] = key
     return (200, html, parsed_headers)