functions-js
functions-js copied to clipboard
Fixes missing body when Content-Type header supplied by developer
What kind of change does this PR introduce?
Fixes null body when user supplies Content-Type in headers of supabase.functions.invoke, ie: invoked like this
const response = await supabase.functions.invoke("stripe-webhook", {
method: "POST",
headers: {
// this causes the body to be null
"Content-Type": "application/json",
},
body: JSON.stringify({
action: "finalizeClinicSetup",
stripeSessionId,
userId,
}),
});
What is the current behavior?
The request body sent over the network will be null, instead of the supplied body value, if a Content-Type header is supplied
Please link any relevant issues here.
What is the new behavior?
If user supplies a Content-Type header, the body will contain its original value supplied by the developer
Just ran into this bug myself - took ages to debug - who would've thought the payload was not getting attached
I want to know why this PR not merge into main branch? It's a frequently mentioned issue. :(
@Efan404 it doesn't seem like they really maintain this repo even though a lot relies on it
You might need to reach out to them to merge this through other channels
Moved to https://github.com/supabase/supabase-js/pull/1758