code: def get_path(environ):
      
      from wsgiref import util
      request_uri = environ.get('REQUEST_URI', environ.get('RAW_URI', ''))
      if request_uri == '':
          uri = util.request_uri(environ)
          host = environ.get('HTTP_HOST', '')
          scheme = util.guess_scheme(environ)
          prefix = "{scheme}://{host}".format(scheme=scheme, host=host)
          request_uri = uri.replace(prefix, '')
      return request_uri
docs: Get the path