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

Parses a JSON request body of the intercepted request #168

Merged
merged 3 commits into from
May 19, 2020

Conversation

kettanaito
Copy link
Member

@kettanaito kettanaito commented May 18, 2020

Changes

  • Parses a JSON request body of the intercepted request, so now req.body is contextually an Object or a string, with no need to explicitly parse it.

GitHub

Roadmap

  • Parse a response JSON body when viewing the logs

@kettanaito
Copy link
Member Author

kettanaito commented May 19, 2020

Encountering this exception during response-patching test:

TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
(see more detailed error stack trace in the mocked response body)

Reason

Caused by a non set req.body received from the worker being treated as an empty string.

Solution

Handles request body outside of the JSON parsing of the worker's message.

@kettanaito kettanaito merged commit 7c8388f into master May 19, 2020
@kettanaito kettanaito deleted the 159-parse-json-body branch May 19, 2020 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"application/json" req.body is not parsed
1 participant