g2p / rfc6266

Content-Disposition header support for Python
GNU Lesser General Public License v3.0
41 stars 43 forks source link

ValueError with empty filename #9

Open sirex opened 8 years ago

sirex commented 8 years ago

How to reproduce:

rfc6266.parse_headers('attachment; filename=""')
Traceback (most recent call last):
  File "contentdisposition.py", line 3, in <module>
    rfc6266.parse_headers('attachment; filename=""')
  File "rfc6266.py", line 232, in parse_headers
    disposition=parsed[0], assocs=parsed[1:], location=location)
  File "rfc6266.py", line 86, in __init__
    self.assocs = dict((key.lower(), val) for (key, val) in assocs)
  File "rfc6266.py", line 86, in <genexpr>
    self.assocs = dict((key.lower(), val) for (key, val) in assocs)
ValueError: need more than 1 value to unpack