Skip to content

Commit

Permalink
fix stripe formating
Browse files Browse the repository at this point in the history
  • Loading branch information
McPizza0 committed Feb 29, 2024
1 parent 524e060 commit 9375cb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/routes/endpoint/[endpointId].ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default defineEventHandler(async (event) => {
endpointId: endpointId,
origin: requestHost,
method: requestMethod,
contentType: contentType || "application/json",
contentType: contentTypeUnparsed || "application/json",
response: {
code: endpointResponse.response.code,
content: endpointResponse.response.content,
Expand Down
9 changes: 6 additions & 3 deletions server/utils/destinationSender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ export async function sendMessageToDestinations(

if (!message || message.orgId !== orgId) return;
const payloadHeaders = message.headers;
const body = isBodyJson(message.contentType)
? (message.bodyJson as JSON)
: (message.body as string);
const body: BodyInit | Record<string, any> | null | undefined = isBodyJson(
message.contentType
)
? message.bodyJson
: message.body;
if (!body || !payloadHeaders) return;

// Handle Forwarding to the destinations
Expand Down Expand Up @@ -95,6 +97,7 @@ export async function sendMessageToDestinations(
| "TRACE"
| undefined) || "POST",
// @ts-ignore - header formating
contentType: message.contentType,
headers: cleanHeaders,
body: body,
}
Expand Down

0 comments on commit 9375cb8

Please sign in to comment.