From 241125e487c84a6ff65daa0e7f69f535ff5b47a6 Mon Sep 17 00:00:00 2001 From: xiongyao Date: Mon, 28 Apr 2025 15:02:14 +0800 Subject: [PATCH] optimize: check request.headers contains "application/json" --- api/app_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app_factory.py b/api/app_factory.py index af4fae34e3..c467b8b0eb 100644 --- a/api/app_factory.py +++ b/api/app_factory.py @@ -29,7 +29,7 @@ def create_flask_app_with_configs() -> DifyApp: # log request data info request_id = get_request_id() - if request.headers.get("content-type", "").lower() == "application/json": + if "application/json" in request.headers.get("content-type", "").lower(): logging.info( f"[before request]|request_id: {request_id}," f" method: {request.method}, url: {request.url}, request_data: {request.get_json()}"