[add]: enforce content type json

This commit is contained in:
VivianDee
2025-03-21 12:12:20 +01:00
parent c0680b3098
commit 293d73518f
8 changed files with 38 additions and 26 deletions
+2 -3
View File
@@ -2,7 +2,7 @@ from flask import Flask
from flask_cors import CORS
from app.config import Config
from app.routes import api
from app.errors import bad_request, method_not_allowed, not_found
from app.errors import method_not_allowed, unsupported_media_type
def create_app():
""" Factory function to create a Flask app instance """
@@ -19,8 +19,7 @@ def create_app():
# Error Handlers
app.register_error_handler(400, bad_request)
app.register_error_handler(404, not_found)
app.register_error_handler(405, method_not_allowed)
app.register_error_handler(415, unsupported_media_type)
return app