def versioned_api_headers(version: str=None) ->dict:
    """Will append the API version information (if any) to the headers.
    Args
        version: the optional version string

    Returns:
        the headers dictionary.
    """
    jsonapi_headers = {'Content-Type': 'application/vnd.qctrl+json',
        'Accept': 'application/vnd.qctrl+json'}
    if version is None:
        return jsonapi_headers
    headers = dict(jsonapi_headers)
    headers['Content-Type'] = headers['Content-Type'] + f'; version={version}'
    headers['Accept'] = headers['Accept'] + f'; version={version}'
    return headers
