File tree Expand file tree Collapse file tree
website/utils/image/engines Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,16 +63,21 @@ const action = async (
6363 throw new Error ( "Missing IS Cookies" ) ;
6464 }
6565
66- await sp [ "POST /event-api/v1/:account/event" ] ( { account : ctx . account } , {
67- body : {
68- ...props ,
69- ...cookies ,
70- agent : req . headers . get ( "user-agent" ) || "deco-sites/apps" ,
66+ const response = await sp [ "POST /event-api/v1/:account/event" ] (
67+ { account : ctx . account } ,
68+ {
69+ body : {
70+ ...props ,
71+ ...cookies ,
72+ agent : req . headers . get ( "user-agent" ) || "deco-sites/apps" ,
73+ } ,
74+ headers : {
75+ "content-type" : "application/json" ,
76+ } ,
7177 } ,
72- headers : {
73- "content-type" : "application/json" ,
74- } ,
75- } ) ;
78+ ) ;
79+
80+ await response . body ?. cancel ( ) ;
7681
7782 return null ;
7883} ;
Original file line number Diff line number Diff line change @@ -33,9 +33,10 @@ const action = async (
3333 form . append ( "newsInternalPart" , part ) ;
3434 form . append ( "newsInternalCampaign" , campaing ) ;
3535
36- await vcsDeprecated [ "POST /no-cache/Newsletter.aspx" ] ( { } , {
36+ const response = await vcsDeprecated [ "POST /no-cache/Newsletter.aspx" ] ( { } , {
3737 body : form ,
3838 } ) ;
39+ await response . body ?. cancel ( ) ;
3940} ;
4041
4142export default action ;
Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ const action = async (
2424 form . append ( "notifymeClientEmail" , email ) ;
2525 form . append ( "notifymeIdSku" , skuId ) ;
2626
27- await vcsDeprecated [ "POST /no-cache/AviseMe.aspx" ] ( { } , { body : form } ) ;
27+ const response = await vcsDeprecated [ "POST /no-cache/AviseMe.aspx" ] ( { } , {
28+ body : form ,
29+ } ) ;
30+ await response . body ?. cancel ( ) ;
2831} ;
2932
3033export default action ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export const createEngine = (
1818 const response = await fetch ( url , { headers : new Headers ( req . headers ) } ) ;
1919
2020 if ( ! response . ok ) {
21+ await response . body ?. cancel ( ) ;
2122 throw new HttpError ( 502 ) ;
2223 }
2324
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ const fetchImage = async (
5959 const response = await fetch ( src , init ) ;
6060
6161 if ( ! response . ok ) {
62+ await response . body ?. cancel ( ) ;
6263 throw new HttpError ( response . status , Deno . inspect ( response ) ) ;
6364 }
6465
You can’t perform that action at this time.
0 commit comments