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

When running the server with -r and -a flags recording file body is empty #16

Open
dennisbcloud opened this issue May 6, 2021 · 3 comments
Labels
bug Something isn't working PR-welcome PR is gladly appreciated

Comments

@dennisbcloud
Copy link

dennisbcloud commented May 6, 2021

hey, Thanks for the project, it looks great. but when i running the server with recording and save-headers flags I get the file (response) body object = null :
{ "statusCode": 200, "headers": { "date": "Wed, 28 Apr 2021 08:53:00 GMT", "content-type": "application/json; charset=utf-8", ... }, "body": null }
if I running the server with recording and without the "save-headers" flag then the file contains correct "body" value.

@dennisbcloud
Copy link
Author

dennisbcloud commented May 6, 2021

i think in recorder.js when this condition
data && ext === 'json' is true then

1 - data = JSON.parse(data.toString('utf8'));
2 - data now is Object ==>
data instanceof Buffer ? (isString ? data.toString('utf8') : data.toString('base64')) : null
will return null.

i dont sure what should be here.

@sinedied
Copy link
Owner

sinedied commented May 7, 2021

Thanks, I'll look into it.

@HarryF514
Copy link

facing same issue here. Did this get fixed?

@sinedied sinedied added bug Something isn't working PR-welcome PR is gladly appreciated labels Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR-welcome PR is gladly appreciated
Projects
None yet
Development

No branches or pull requests

3 participants