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

Fix #39, turn off cors #40

Merged
merged 1 commit into from
Oct 26, 2023
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.30 - Turn off cors mode

- Turn off cors mode fix issue with multi headers
- Fix #39

## 0.0.29 - Fix SKPI Fingerprint, minor improvements

- Fix SKPI fingerprint
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jambox",
"version": "0.0.29",
"version": "0.0.30",
"description": "Tool for recording and playing back HTTP requests.",
"bin": {
"jam": "./jam.mjs",
Expand Down
1 change: 0 additions & 1 deletion src/server/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const getServices = (filesystem) => {
const ews = expessWS(app);
const cache = new Cache();
const proxy = mockttp.getLocal({
cors: true,
recordTraffic: false,
suggestChanges: false,
https: {
Expand Down
7 changes: 5 additions & 2 deletions src/utils/serialize.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ export const updateResponse = async (prev, curr) => {
...rest,
};

// Update the final buffer and content length
result.body.buffer = buffer;
result.headers['content-length'] = buffer.length;

// Update the final buffer and content length
if ('content-length' in result.headers) {
result.headers['content-length'] = buffer.length;
}

return result;
};