<commit_before>"""
Rhizi web API
"""
import os
import db_controller as dbc
import json
from flask import jsonify

from flask import Flask
from flask import request

webapp = Flask(__name__)
webapp.debug = True
<commit_msg>extend Flask class to allow customization of HTTP OPTIONS method response<commit_after>"""
Rhizi web API
"""
import os
import db_controller as dbc
import json
from flask import jsonify

from flask import Flask
from flask import request
from flask import make_response


class FlaskExt(Flask):
    """
    Flask server customization
    """

    def make_default_options_response(self):
        # sup = super(Flask, self)
        ret = Flask.make_default_options_response(self)
        ret.headers['Access-Control-Allow-Origin'] = '*'
        ret.headers['Access-Control-Allow-Headers'] = "Origin, Content-Type, Accept, Authorization"
        return ret

webapp = FlaskExt(__name__)
webapp.debug = True

{'fraction_non_alphanumeric': 0.08225108225108226, 'fraction_numerical': 0.0, 'mean_word_length': 4.138888888888889, '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': '2315264', 'n_tokens_mistral': 280, 'n_tokens_neox': 266, 'n_words': 90}