def get_boundary_from_response(response):
    """ Parses the response header and returns the boundary.

    :param response: response containing the header that contains the boundary
    :return: a binary string of the boundary
    """
    # Read only the first value with key 'content-type' (duplicate keys are allowed)
    content = response.headers.pop('content-type')[0]
    # Find the start and end index of the boundary
    b_start = content.find(b'boundary=')
    b_end = content[b_start:].find(b';')
    # Separate out boundary
    if b_end == -1:
        # If the end point is not found, just go to the end of the content string
        boundary = content[b_start+9:]
    else:
        boundary = content[b_start+9:b_start+b_end]
    return boundary