Returns the canonicalized header name for the header name provided as an argument.
    The canonicalized header name according to the HTTP RFC is Kebab-Camel-Case.

    Keyword arguments:
    key -- the name of the header

def canonicalize_header(key):
    """Returns the canonicalized header name for the header name provided as an argument.
    The canonicalized header name according to the HTTP RFC is Kebab-Camel-Case.

    Keyword arguments:
    key -- the name of the header
    """
    bits = key.split('-')
    for idx, b in enumerate(bits):
        bits[idx] = b.capitalize()
    return '-'.join(bits)