def xframe_options_sameorigin(view_func):
 def wrapped_view(*args, **kwargs):
  resp = view_func(*args, **kwargs)
  if (resp.get('X-Frame-Options', None) is None):
   resp['X-Frame-Options'] = 'SAMEORIGIN'
  return resp
 return wraps(view_func, assigned=available_attrs(view_func))(wrapped_view)

def xframe_options_sameorigin ( view_func ) : def wrapped_view ( * args , ** kwargs ) : resp = view_func ( * args , ** kwargs ) if ( resp . get ( 'X-Frame-Options' , None ) is None ) : resp [ 'X-Frame-Options' ] = 'SAMEORIGIN' return resp return wraps ( view_func , assigned = available_attrs ( view_func ) ) ( wrapped_view )
modifies a view function so its response has the x-frame-options http header set to sameorigin as long as the response doesnt already have that header set .