code: def _check_refer_redirect(self, environ):
          
          referer = environ.get('HTTP_REFERER')
          if not referer:
              return
  
          host = environ.get('HTTP_HOST')
          if host not in referer:
              return
  
          inx = referer[1:].find('http')
          if not inx:
              inx = referer[1:].find('///')
              if inx > 0:
                  inx + 1
  
          if inx < 0:
              return
  
          url = referer[inx + 1:]
          host = referer[:inx + 1]
  
          orig_url = environ['PATH_INFO']
          if environ.get('QUERY_STRING'):
              orig_url += '?' + environ['QUERY_STRING']
  
          full_url = host + urljoin(url, orig_url)
          return WbResponse.redir_response(full_url, '307 Redirect')
docs: Returns a WbResponse for a HTTP 307 redirection if the HTTP referer header is the same as the HTTP host header
  
          :param dict environ: The WSGI environment dictionary for the request
          :return: WbResponse HTTP 307 redirection
          :rtype: WbResponse