(url, code=None)
Aborts execution and causes a 303 or 302 redirect, depending on
        the HTTP protocol version.
Aborts execution and causes a 303 or 302 redirect, depending on
        the HTTP protocol version.
Aborts execution and causes a 303 or 302 redirect depending on the HTTP protocol version .
def redirect(url, code=None):
    """ Aborts execution and causes a 303 or 302 redirect, depending on
        the HTTP protocol version. """
    if not code:
        code = 303 if request.get('SERVER_PROTOCOL') == "HTTP/1.1" else 302
    res = response.copy(cls=HTTPResponse)
    res.status = code
    res.body = ""
    res.set_header('Location', urljoin(request.url, url))
    raise res
def redirect ( url , code = None ) : if not code : code = 303 if request . get ( 'SERVER_PROTOCOL' ) == "HTTP/1.1" else 302 res = response . copy ( cls = HTTPResponse ) res . status = code res . body = "" res . set_header ( 'Location' , urljoin ( request . url , url ) ) raise res