mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
fix(web): replace Response.json with legacy Response constructor for pre-Chrome 105 compatibility(#31091) (#31095)
Co-authored-by: Xiaoba Yu <xb1823725853@gmail.com>
This commit is contained in:
@ -24,8 +24,12 @@ export type FetchOptionType = Omit<RequestInit, 'body'> & {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const afterResponse204: AfterResponseHook = async (_request, _options, response) => {
|
const afterResponse204: AfterResponseHook = async (_request, _options, response) => {
|
||||||
if (response.status === 204)
|
if (response.status === 204) {
|
||||||
return Response.json({ result: 'success' })
|
return new Response(JSON.stringify({ result: 'success' }), {
|
||||||
|
status: 200,
|
||||||
|
headers: { 'Content-Type': ContentType.json },
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ResponseError = {
|
export type ResponseError = {
|
||||||
|
|||||||
Reference in New Issue
Block a user