Skip to content

Commit

Permalink
fix CORS issue on chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
sumn2u committed Jul 16, 2024
1 parent 7228b60 commit 28c62ac
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def save_settings(settings):


@app.route("/save", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def save_annotate_info():
try:
request_data = request.get_json()
Expand Down Expand Up @@ -132,13 +131,11 @@ def save_settings(settings):


@app.route("/settings", methods=["GET"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def get_settings():
return jsonify(initial_settings)


@app.route("/settings", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def update_settings():
new_settings = request.json
initial_settings.update(new_settings)
Expand All @@ -147,7 +144,6 @@ def update_settings():


@app.route("/settings/reset", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def reset_settings():
global initial_settings
initial_settings = default_settings.copy()
Expand All @@ -156,7 +152,6 @@ def reset_settings():


@app.route("/upload", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def upload_file():
try:
uploaded_files = []
Expand Down Expand Up @@ -227,7 +222,6 @@ def delete_file(filename):


@app.route("/activeImage", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def save_active_image_info():
try:
request_data = request.get_json()
Expand Down Expand Up @@ -344,7 +338,6 @@ def add_regions(regions, region_type=None):


@app.route("/imagesName", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def images_name():
try:
data = request.get_json()
Expand Down Expand Up @@ -378,7 +371,6 @@ def clear_upload_folder():


@app.route("/clearSession", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def clear_session():
global initial_settings
try:
Expand All @@ -393,7 +385,6 @@ def clear_session():


@app.route("/download_configuration", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def download_configuration():
try:
data = request.get_json()
Expand Down Expand Up @@ -427,7 +418,6 @@ def download_configuration():


@app.route("/class_distribution", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def class_distribution():
try:
class_data = dbModule.get_class_distribution()
Expand All @@ -445,7 +435,6 @@ def class_distribution():


@app.route("/download_image_with_annotations", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def download_image_with_annotations():
temp_dir = None # Initialize temporary directory variable

Expand Down Expand Up @@ -751,7 +740,6 @@ def get_image_annotations():


@app.route("/download_image_mask", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def download_image_mask():
try:
data = request.get_json()
Expand Down Expand Up @@ -1080,7 +1068,6 @@ def create_yolo_annotations(image_names, color_map=None):


@app.route("/download_yolo_annotations", methods=["POST"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def download_yolo_annotations():
data = request.get_json()
image_names = data.get("image_names", [])
Expand Down Expand Up @@ -1133,7 +1120,6 @@ def download_yolo_annotations():


@app.route("/imagesInfo", methods=["GET"])
@cross_origin(origin=client_url, headers=["Content-Type"])
def get_images_info():
global path

Expand Down

0 comments on commit 28c62ac

Please sign in to comment.