]> granicus.if.org Git - python/commit
get_content_type(), get_content_maintype(), get_content_subtype(): RFC
authorBarry Warsaw <barry@python.org>
Tue, 20 Aug 2002 14:50:09 +0000 (14:50 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 20 Aug 2002 14:50:09 +0000 (14:50 +0000)
commitf36d804b3b5a73814287535bbc840c3df33d9e2d
tree717a49b56b3295d13899180d5f777d38f7cd97e4
parentdfea3b3963228fc149c586463b01fcaf39510902
get_content_type(), get_content_maintype(), get_content_subtype(): RFC
2045, section 5.2 states that if the Content-Type: header is
syntactically invalid, the default type should be text/plain.
Implement minimal sanity checking of the header -- it must have
exactly one slash in it.  This closes SF patch #597593 by Skip, but in
a different way.

Note that these methods used to raise ValueError for invalid ctypes,
but now they won't.
Lib/email/Message.py