c-bata / webframework-in-python

"How to write WSGI WEB Framework" talked at PyConJP 2016
https://c-bata.github.io/webframework-in-python/
25 stars 3 forks source link

CONTENT_LENGTH exception if 'CONTENT_LENGTH' = '' #11

Closed kuteken closed 6 years ago

kuteken commented 6 years ago

I've got a error if 'CONTENT_LENGTH' = ''

Error message

Traceback (most recent call last):
(omit)
  File "(omit)/app.py", line 73, in body
    content_length = int(self.environ.get('CONTENT_LENGTH', 0))
ValueError: invalid literal for int() with base 10: ''

Conditions for error