Skip to content

Conversation

mandarini
Copy link
Contributor

Moved from: supabase/functions-js#90
Author: @ggaabe

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

@coveralls
Copy link

coveralls commented Oct 9, 2025

Coverage Status

coverage: 95.455% (+13.0%) from 82.5%
when pulling 0054692 on fix/functions-client-fix
into 188fa17 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants