Changeset 8:32111cd994e9
- Timestamp:
- 04/16/05 02:45:05 (3 years ago)
- Files:
-
- flup/server/scgi_base.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
flup/server/scgi_base.py
r2 r8 268 268 requestClass = Request 269 269 270 def __init__(self, application, environ=None,270 def __init__(self, application, scriptName='', environ=None, 271 271 multithreaded=True, 272 272 bindAddress=('localhost', 4000), allowedServers=None, 273 273 loggingLevel=logging.INFO): 274 274 """ 275 scriptName is the initial portion of the URL path that "belongs" 276 to your application. It is used to determine PATH_INFO (which doesn't 277 seem to be passed in). An empty scriptName means your application 278 is mounted at the root of your virtual host. 279 275 280 environ, which must be a dictionary, can contain any additional 276 281 environment variables you want to pass to your application. … … 293 298 294 299 self.application = application 300 self.scriptName = scriptName 295 301 self.environ = environ 296 302 self.multithreaded = multithreaded … … 345 351 else: 346 352 environ['wsgi.url_scheme'] = 'http' 353 354 self._sanitizeEnv(environ) 347 355 348 356 headers_set = [] … … 426 434 self._appLock.release() 427 435 436 def _sanitizeEnv(self, environ): 437 """Fill-in/deduce missing values in environ.""" 438 # Namely SCRIPT_NAME/PATH_INFO 439 value = environ['SCRIPT_NAME'] 440 scriptName = self.scriptName 441 if not value.startswith(scriptName): 442 self.logger.warning('scriptName does not match request URI') 443 444 environ['PATH_INFO'] = value[len(scriptName):] 445 environ['SCRIPT_NAME'] = scriptName 446 428 447 def error(self, request): 429 448 """