utils/security_headers.py
def ensure_headers(r, headers):
    """Set headers on a response if not already set"""
    r = r if isinstance(r, HTTPResponse) else response

    for k, v in headers.items():
        if k not in r.headers:
            r.set_header(k, v)
Set headers on a response if not already set
Set headers on a response if not already set
Set headers on a response if not already set
def ensure_headers(r, headers):
    r = r if isinstance(r, HTTPResponse) else response
    for k, v in headers.items():
        if k not in r.headers:
            r.set_header(k, v)
def ensure_headers ( r , headers ) : r = r if isinstance ( r , HTTPResponse ) else response for k , v in headers . items ( ) : if k not in r . headers : r . set_header ( k , v )
Set headers on a response if not already set
Set headers on a response if not already set
"""Set headers on a response if not already set"""
r
headers