Exemplo n.º 1
0
 def handle_normal_request(self, environ):
     user_environ = self.get_user_environ(environ)
     script = environ.pop(http_runtime_constants.SCRIPT_HEADER)
     body = environ['wsgi.input'].read(int(environ.get('CONTENT_LENGTH',
                                                       0)))
     url = 'http://%s:%s%s?%s' % (
         user_environ['SERVER_NAME'], user_environ['SERVER_PORT'],
         urllib.quote(environ['PATH_INFO']), environ['QUERY_STRING'])
     return runtime.HandleRequest(user_environ, script, url, body,
                                  self.config.application_root,
                                  self._PYTHON_LIB_DIR)
Exemplo n.º 2
0
 def handle_normal_request(self, environ):
   """Handles a user request using the given WSGI environ."""
   user_environ = self.get_user_environ(environ)
   script = environ.pop(http_runtime_constants.SCRIPT_HEADER)
   body = environ['wsgi.input'].read(int(environ.get('CONTENT_LENGTH', 0)))
   url_scheme = 'http'
   if 'HTTP_X_APPENGINE_DEV_LOCALSSL' in environ:
     url_scheme = 'https'
   url = '%s://%s:%s%s?%s' % (url_scheme,
                              self._get_request_host(user_environ),
                              user_environ['SERVER_PORT'],
                              urllib.quote(environ['PATH_INFO']),
                              environ['QUERY_STRING'])
   return runtime.HandleRequest(user_environ, script, url, body,
                                self.config.application_root,
                                self._PYTHON_LIB_DIR)