def build_http_response(data, content_type='text/html', response_code='200 OK'):
    """
    Base HTTP response maker.
    ----
    data (str | bytes) : Data to be packed into an HTTP response
    content_type (str) : Mimetype of data
    response_code (str) : HTTP response code
    ----
    Returns (bytes) of the packaged HTTP response.
    """

    http_header = f'HTTP/1.1 {response_code}\r\nContent-Type: {content_type}\r\nContent-Length: {len(data)}\r\n\r\n'

    if content_type.startswith('text') and type(data) != bytes:
        return bytes(http_header + data, 'utf-8')
    else:
        return bytes(http_header, 'utf-8') + data