예제 #1
0
def redirect(location):
    """
    Return a `Response` with temporary redirect code (302) and forward to `location`.
    """
    response = Response()
    response.status_code = 302
    response.headers["Location"] = location
    return response
예제 #2
0
def permanent_redirect(location):
    """
    Return a `Response` with permanent redirect code (301) and forward to `location`.
    """
    response = Response()
    response.status_code = 301
    response.headers["Location"] = location
    return response