Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes missing body when Content-Type header supplied by developer #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ggaabe
Copy link

@ggaabe ggaabe commented Aug 4, 2024

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

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.

1 participant