mirror of https://github.com/langgenius/dify.git
fix: set response content type with charset in helper (#29534)
This commit is contained in:
parent
05f63c88c6
commit
761f8c8043
|
|
@ -215,7 +215,11 @@ def generate_text_hash(text: str) -> str:
|
|||
|
||||
def compact_generate_response(response: Union[Mapping, Generator, RateLimitGenerator]) -> Response:
|
||||
if isinstance(response, dict):
|
||||
return Response(response=json.dumps(jsonable_encoder(response)), status=200, mimetype="application/json")
|
||||
return Response(
|
||||
response=json.dumps(jsonable_encoder(response)),
|
||||
status=200,
|
||||
content_type="application/json; charset=utf-8",
|
||||
)
|
||||
else:
|
||||
|
||||
def generate() -> Generator:
|
||||
|
|
|
|||
Loading…
Reference in New Issue