Ejemplo n.º 1
0
def missing_auth(handler: ZoeRequestHandler):
    """Sends a 401 response that enables basic auth"""
    handler.set_status(
        401,
        'Could not verify your access level for that URL. You have to login with proper credentials.'
    )
    handler.set_header('WWW-Authenticate', 'Basic realm="Login Required"')
    handler.finish()
Ejemplo n.º 2
0
def error_page(handler: ZoeRequestHandler, error_message: str, status: int):
    """Generate an error page."""
    handler.set_status(status)
    handler.render('error.html', error=error_message)
Ejemplo n.º 3
0
def missing_auth(handler: ZoeRequestHandler):
    """Sends a 401 response that enables basic auth"""
    handler.set_status(401, 'Could not verify your access level for that URL. You have to login with proper credentials.')
    handler.set_header('WWW-Authenticate', 'Basic realm="Login Required"')
    handler.finish()
Ejemplo n.º 4
0
def error_page(handler: ZoeRequestHandler, error_message: str, status: int):
    """Generate an error page."""
    handler.set_status(status)
    handler.render('error.html', error=error_message)