Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle empty content type

  • Loading branch information...
commit c5f66a1aa7c85c53a519c8fee2da9b7c5b5c9d17 1 parent 2a36dbd
Andrew Fleenor authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 mediatype.py
6 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
Please sign in to comment.
Something went wrong with that request. Please try again.