Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/e2e/mockServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ export const startServer = async (mockServerListener) => {
return new Promise((resolve) => {
const app = express();

app.use(bodyParser.text());
app.use(bodyParser.json());

// Handles batch events
app.post('/events', (req, res) => {
console.log(`➡️ Received request`);
const body = JSON.parse(req.body);
const body = req.body;
mockServerListener(body);

res.status(200).send({ mockSuccess: true });
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/__tests__/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('#sendEvents', () => {
writeKey: 'SEGMENT_KEY',
}),
headers: {
'Content-Type': 'text/plain',
'Content-Type': 'application/json; charset=utf-8',
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const uploadEvents = async ({
writeKey: writeKey,
}),
headers: {
'Content-Type': 'text/plain',
'Content-Type': 'application/json; charset=utf-8',
},
});
};