#NEWLINE# def apply( self , callback , context ) : #NEWLINE# #INDENT# 'method called for wrap plugin operation' #NEWLINE# def wrapper( * args , **kwargs ) : #NEWLINE# #INDENT# 'Check request and raise if its not https' #NEWLINE# if ( request . headers . get ( 'X-Forwarded-Proto' , 'http' ) != 'https' ) : #NEWLINE# #INDENT# raise self . default_non_ssl_http_response #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return callback ( * args , ** kwargs ) #NEWLINE# #UNINDENT# #UNINDENT# return context