Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): replace Response.json with legacy Response constructor for pre-Chrome 105 compatibility(#31091) (#31095)

XiaoBae9f0e1e83994
diff --git a/web/service/fetch.ts b/web/service/fetch.ts
index d6f1af3b3f3..04dfe74cc2d 100644
--- a/web/service/fetch.ts
+++ b/web/service/fetch.ts
@@ -24,8 +24,12 @@ export type FetchOptionType = Omit<RequestInit, 'body'> & {
}
const afterResponse204: AfterResponseHook = async (_request, _options, response) => {
- if (response.status === 204)
- return Response.json({ result: 'success' })
+ if (response.status === 204) {
+ return new Response(JSON.stringify({ result: 'success' }), {
+ status: 200,
+ headers: { 'Content-Type': ContentType.json },
+ })
+ }
}
export type ResponseError = {