Browse Source

Accept MIME records that have only LF line endings.

Some tool developers just ignore the rule requiring CRLF.
tags/1.1.1RC1
shypike 9 years ago
parent
commit
53051a94ee
  1. 4
      cherrypy/_cpreqbody.py

4
cherrypy/_cpreqbody.py

@ -626,10 +626,10 @@ class Part(Entity):
# No more data--illegal end of headers
raise EOFError("Illegal end of headers.")
if line == ntob('\r\n'):
if line == ntob('\r\n') or line == ntob('\n'):
# Normal end of headers
break
if not line.endswith(ntob('\r\n')):
if not line.endswith(ntob('\n')):
raise ValueError("MIME requires CRLF terminators: %r" % line)
if line[0] in ntob(' \t'):

Loading…
Cancel
Save