<commit_before>class RemoveEtagFromHTMLApiViewMiddleware:
    def __init__(self, get_response):
        self.get_response = get_response

    def __call__(self, request):
        response = self.get_response(request)

        if request.path.startswith('/api/'):
            if response['content-type'].startswith('text/html') and response.has_header('etag'):
                del response['etag']

        return response<commit_msg>api should not break if it sends a 304<commit_after>class RemoveEtagFromHTMLApiViewMiddleware:
    def __init__(self, get_response):
        self.get_response = get_response

    def __call__(self, request):
        response = self.get_response(request)

        if request.path.startswith('/api/'):
            if response.has_header('content-type') and response['content-type'].startswith('text/html'):
                if response.has_header('etag'):
                    del response['etag']

        return response
{'fraction_non_alphanumeric': 0.10830704521556257, 'fraction_numerical': 0.0031545741324921135, 'mean_word_length': 2.9502074688796682, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2823149', 'n_tokens_mistral': 266, 'n_tokens_neox': 255, 'n_words': 53}