def makeContentType (mime, charset=None):
    """ Create value of Content-Type WARC header with optional charset """
    s = [mime]
    if charset:
        s.extend (['; charset=', charset])
    return ''.join (s)