[~] Refactor
This commit is contained in:
parent
12977088fa
commit
b0ff8b86de
6
d1/f2.py
6
d1/f2.py
@ -12,6 +12,7 @@ sys.path.insert(0, os.path.dirname(__file__))
|
|||||||
|
|
||||||
|
|
||||||
def application(environ, start_response):
|
def application(environ, start_response):
|
||||||
|
try:
|
||||||
t4 = int(environ.get('CONTENT_LENGTH', '0'))
|
t4 = int(environ.get('CONTENT_LENGTH', '0'))
|
||||||
t3 = environ['wsgi.input'].read(t4)
|
t3 = environ['wsgi.input'].read(t4)
|
||||||
def op1(rh):
|
def op1(rh):
|
||||||
@ -81,7 +82,6 @@ def application(environ, start_response):
|
|||||||
t9 = t9.replace('Transfer-Encoding: chunked\r\n', '')
|
t9 = t9.replace('Transfer-Encoding: chunked\r\n', '')
|
||||||
t9 += 'Content-Length: %d\r\n' % len(t10)
|
t9 += 'Content-Length: %d\r\n' % len(t10)
|
||||||
t11 = t9.encode('utf-8') + t10
|
t11 = t9.encode('utf-8') + t10
|
||||||
response += pprint.pformat(dict(t9=t9, t10=t10, t11=t11))
|
|
||||||
t13 = t9.splitlines()[0]
|
t13 = t9.splitlines()[0]
|
||||||
t14 = t13.find(' ')
|
t14 = t13.find(' ')
|
||||||
t15 = t13[t14 + 1:]
|
t15 = t13[t14 + 1:]
|
||||||
@ -95,4 +95,8 @@ def application(environ, start_response):
|
|||||||
else:
|
else:
|
||||||
t1 = start_response(t15, t16)
|
t1 = start_response(t15, t16)
|
||||||
t1(t10)
|
t1(t10)
|
||||||
|
except:
|
||||||
|
with io.open('log.txt', 'a') as f:
|
||||||
|
f.write(traceback.format_exc())
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
Loading…
Reference in New Issue
Block a user