def check_padding(query):
    """
    Check for missing padding in base64 encoding and fill it up with "=".

    :param query:
    :return: query
    """

    missing_padding = len(query) % 4
    if missing_padding:
        query += "=" * (4 - missing_padding)
    return query