refactor: better error handler (#24422)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN- 2025-08-25 09:28:42 +08:00 • committed by GitHub
commit fe06d266e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 113 additions and 78 deletions

View file

@ -29,7 +29,6 @@ def init_app(app: DifyApp):
methods=["GET", "PUT", "POST", "DELETE", "OPTIONS", "PATCH"],
expose_headers=["X-Version", "X-Env"],
)
app.register_blueprint(web_bp)
CORS(
@ -40,10 +39,13 @@ def init_app(app: DifyApp):
methods=["GET", "PUT", "POST", "DELETE", "OPTIONS", "PATCH"],
expose_headers=["X-Version", "X-Env"],
)
app.register_blueprint(console_app_bp)
CORS(files_bp, allow_headers=["Content-Type"], methods=["GET", "PUT", "POST", "DELETE", "OPTIONS", "PATCH"])
CORS(
files_bp,
allow_headers=["Content-Type"],
methods=["GET", "PUT", "POST", "DELETE", "OPTIONS", "PATCH"],
)
app.register_blueprint(files_bp)
app.register_blueprint(inner_api_bp)