mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
_dispatch(): Use get_content_maintype() and get_content_subtype() to
get the MIME main and sub types, instead of getting the whole ctype and splitting it here. The two more specific methods now correctly implement RFC 2045, section 5.2.
This commit is contained in:
parent
75585d4ec1
commit
dfea3b3963
1 changed files with 2 additions and 3 deletions
|
@ -123,9 +123,8 @@ class Generator:
|
|||
# self._handle_<maintype>_<subtype>(). If there's no handler for the
|
||||
# full MIME type, then dispatch to self._handle_<maintype>(). If
|
||||
# that's missing too, then dispatch to self._writeBody().
|
||||
ctype = msg.get_content_type()
|
||||
# We do have a Content-Type: header.
|
||||
main, sub = ctype.split('/')
|
||||
main = msg.get_content_maintype()
|
||||
sub = msg.get_content_subtype()
|
||||
specific = UNDERSCORE.join((main, sub)).replace('-', '_')
|
||||
meth = getattr(self, '_handle_' + specific, None)
|
||||
if meth is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue