def setup_requests_scheme(config):
 settings = config.get_settings()
 http_scheme = settings['http_scheme']
 http_host = settings['http_host']
 def on_new_request(event):
  if http_scheme:
   event.request.scheme = http_scheme
  if http_host:
   event.request.host = http_host
 if (http_scheme or http_host):
  config.add_subscriber(on_new_request, NewRequest)

def setup_requests_scheme ( config ) : settings = config . get_settings ( ) http_scheme = settings [ 'http_scheme' ] http_host = settings [ 'http_host' ] def on_new_request ( event ) : if http_scheme : event . request . scheme = http_scheme if http_host : event . request . host = http_host if ( http_scheme or http_host ) : config . add_subscriber ( on_new_request , NewRequest )
force server scheme .