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

SyntaxError when trying to record a GET request with no body #16

Closed
mj12albert opened this issue Jan 10, 2019 · 3 comments
Closed

SyntaxError when trying to record a GET request with no body #16

mj12albert opened this issue Jan 10, 2019 · 3 comments

Comments

@mj12albert
Copy link

Getting this error when trying to record a get request with no body

Error handing request SyntaxError: Unexpected end of JSON input
    at JSON.parse
    at Tape.normalizeBody
    at new Tape

I think its from here? https://github.com/ijpiantanida/talkback/blob/master/src/tape.js#L69

JSON.parse error when this.req.body is undefined

@ijpiantanida
Copy link
Owner

Is this from the incoming request, or from a saved tape?

Incoming requests always have at least an empty body (https://github.com/ijpiantanida/talkback/blob/master/src/server.js#L22)

And tapes are expected to always have the body property, at least set to an empty string.

@mj12albert
Copy link
Author

I see, this is from the incoming request. (trying to save a tape)

so it must be something wrong with the data in the response body... 🤔

@ijpiantanida
Copy link
Owner

Hi @mj12albert.
It turns out there was a problem with empty requests after all.

I just published v1.8.1 with a fix.

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

No branches or pull requests

2 participants