BenParr
05/25/2023, 10:35 AMawait fetch("https://webhook.site/5edcbf89-476d-451e-9d16", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
1: cfAccessClientId,
2: cfAccessClientSecret,
}),
});
Somehow when I send a fetch request wrangler secrets added via pipeline seem to have a bom (\ueff
) added to the start. When I use worker environment variables it is not added. Has anyone seen this extremely strange behaviour before??? I have tried doing a find and replace in the javascript but looks like they only added when fetch request sent.divby0
05/25/2023, 1:22 PMlogs
and an empty exceptions
field. Weirdly the outcome
field is "ok" even thought the event.response.status
is 500 and clearly not okay. What may have gone wrong? How does the outcome field get set to ok?kian
05/25/2023, 1:24 PMkian
05/25/2023, 1:24 PMdivby0
05/25/2023, 1:38 PMkian
05/25/2023, 1:39 PMts
export default <ExportedHandler> {
fetch() {
return new Response(null, {
status: 500,
});
},
};
That'd cause what you're seeing - where the script outcome was ok
as it didn't encounter any issues but the response status is 500.kian
05/25/2023, 1:39 PMkian
05/25/2023, 1:40 PMts
export default <ExportedHandler> {
fetch() {
try {
throw new Error()
} catch {
return new Response(null, {
status: 500,
})
}
},
};
kian
05/25/2023, 1:41 PMtry/catch
then you'd get an outcome of exception
divby0
05/25/2023, 1:44 PMBjarni (Genki)
05/25/2023, 4:22 PMChaika
05/25/2023, 4:24 PMBjarni (Genki)
05/25/2023, 4:25 PMPeter Belbin
05/25/2023, 4:50 PMkian
05/25/2023, 4:51 PMPeter Belbin
05/25/2023, 4:52 PMPeter Belbin
05/25/2023, 4:55 PMDani Foldi
05/25/2023, 4:55 PMkian
05/25/2023, 4:56 PMPeter Belbin
05/25/2023, 5:04 PMPeter Belbin
05/25/2023, 5:07 PMPeter Belbin
05/25/2023, 5:09 PMPeter Belbin
05/25/2023, 5:12 PMPeter Belbin
05/25/2023, 5:21 PMJames
05/25/2023, 5:34 PMJames
05/25/2023, 5:34 PMJames
05/25/2023, 5:35 PMPeter Belbin
05/25/2023, 5:36 PMPeter Belbin
05/25/2023, 5:37 PM