Fix some minor errors found during actual implementation of
example code.
This commit is contained in:
parent
a214fcda03
commit
b38414cc2a
|
@ -198,8 +198,7 @@ server.
|
|||
|
||||
def run_with_cgi(application):
|
||||
|
||||
environ = {}
|
||||
environ.update(os.environ)
|
||||
environ = dict(os.environ.items())
|
||||
environ['wsgi.input'] = sys.stdin
|
||||
environ['wsgi.errors'] = sys.stderr
|
||||
environ['wsgi.version'] = (1,0)
|
||||
|
@ -207,9 +206,6 @@ server.
|
|||
environ['wsgi.multiprocess'] = True
|
||||
environ['wsgi.last_call'] = True
|
||||
|
||||
# XXX really should set defaults for WSGI-required variables;
|
||||
# see "environ Variables" section below
|
||||
|
||||
if environ.get('HTTPS','off') in ('on','1'):
|
||||
environ['wsgi.url_scheme'] = 'https'
|
||||
else:
|
||||
|
@ -251,6 +247,8 @@ server.
|
|||
try:
|
||||
for data in result:
|
||||
write(data)
|
||||
if not headers_sent:
|
||||
write('') # force headers to be sent
|
||||
finally:
|
||||
if hasattr(result,'close'):
|
||||
result.close()
|
||||
|
|
Loading…
Reference in New Issue