Skip to content

fix CORS issue on chrome #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading