Skip to content

Commit

Permalink
fix: change content type to json (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscb authored Oct 20, 2023
1 parent a0a3b0d commit e8ddeb4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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',
},
});
};

0 comments on commit e8ddeb4

Please sign in to comment.