docs: def get_url_adapter(_domain_name):
      """
      Fetch a domain url_adapter object, and bind it to according domain
      """
      from werkzeug._compat import wsgi_decoding_dance
  
      domain = application.domains.get(_domain_name, {})
      server_name = None
      if domain.get('domain', ''):
          server_name = domain['domain']
          try:
              env = {}
              environ = request.environ
              env['url_scheme'] = environ['wsgi.url_scheme']
              env['default_method'] = environ['REQUEST_METHOD']
  
              def _get_wsgi_string(name):
                  val = environ.get(name)
                  if val is not None:
                      return wsgi_decoding_dance(val, "utf-8")
  
              env['script_name'] = _get_wsgi_string('SCRIPT_NAME')
              env['path_info'] = _get_wsgi_string('PATH_INFO')
              env['query_args'] = _get_wsgi_string('QUERY_STRING')
          except:
              env = {}
          adapter = url_map.bind(server_name, **env)
      else:
          try:
              env = request.environ
          except:
              #this env if for testing only
              env = {
                  'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;'
                                 'q=0.9,*/*;q=0.8',
                  'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
                  'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch',
                  'HTTP_ACCEPT_LANGUAGE': 'uk,en-US;q=0.8,en;q=0.6',
                  'HTTP_CACHE_CONTROL': 'max-age=0',
                  'HTTP_CONNECTION': 'keep-alive',
                  # 'HTTP_HOST': 'localhost:8080',
                  'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux i686)',
                  # 'PATH_INFO': '/',
                  # 'QUERY_STRING': '',
                  'REMOTE_ADDR': '127.0.0.1',
                  'REQUEST_METHOD': 'GET',
                  'REQUEST_URI': '/',
                  'SCRIPT_NAME': '',
                  'SERVER_NAME': 'localhost',
                  'SERVER_PORT': '8080',
                  'SERVER_PROTOCOL': 'HTTP/1.1',
                  'wsgi.errors': None,
                  'wsgi.file_wrapper': None,
                  # 'wsgi.input': BytesIO(ntob('', 'utf-8')),
                  'wsgi.multiprocess': False,
                  'wsgi.multithread': False,
                  'wsgi.run_once': False,
                  'wsgi.url_scheme': 'http',
                  'wsgi.version': (1, 0),
              }
          adapter = url_map.bind_to_environ(env)
      return adapter