Permalink
Browse files

Handle empty content type

  • Loading branch information...
1 parent 2a36dbd commit c5f66a1aa7c85c53a519c8fee2da9b7c5b5c9d17 Andrew Fleenor committed Jul 12, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 mediatype.py
View
@@ -25,6 +25,12 @@ def __init__(self, data):
Args:
data = string, the media type string
'''
+ if not data:
+ log.warning('Setting empty media type to x-unknown-content-type')
+ self.type = 'application'
+ self.subtype = 'x-unknown-content-type'
+ params = {}
+ return
match = self.mediatype_re.match(data)
if match:
# get type/subtype

0 comments on commit c5f66a1

Please sign in to comment.