Skip to content

Conversation

@geminigeek
Copy link
Contributor

hi,
currently we are initializing safeDispatcher outside of the safeFetch function, which is causing edge case issue with bun and undici polyfill

like this

const safeDispatcher = new Agent().compose(ssrfFilterInterceptor)

if we move this to the function safeFetch , we can get rid of edge case (see below) , if user set skipSafeFetch: true.

i have implemented this like that in this PR, till bun fixes undici polyfill issue this is a temporary fix.

related issues payload
#12622 (comment) #12622 (comment)

related issues Bun
oven-sh/bun#17799
oven-sh/bun#20022

… false

hi, 
currently we are initializing safeDispatcher outside of the safeFetch function, which is causing edge case issue with bun and undici polyfill

like this 
https://github.com/payloadcms/payload/blob/30fc7e3012dae81b3f727b35ff6917e75f271df1/packages/payload/src/uploads/safeFetch.ts#L52

if we move this to the function safeFetch  , we can get rid of edge case like these , if user set `skipSafeFetch: true`.

i have implemented this like that in this PR, till bun fixes undici polyfill issue this is a temporary fix.


related issues payload
payloadcms#12622 (comment)
payloadcms#12622 (comment)


related issues Bun
oven-sh/bun#17799
oven-sh/bun#20022
@geminigeek geminigeek changed the title fix: bun undici issue only initialize safeDispatcher if skipSafeFetch is false Jul 3, 2025
@geminigeek geminigeek mentioned this pull request Jul 3, 2025
@geminigeek geminigeek changed the title fix: bun undici pollyfill issue, only initialize safeDispatcher if skipSafeFetch is false Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant