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

Incorrect handling of JSON null values #3

Closed
bbyars opened this Issue Apr 24, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@bbyars
Owner

bbyars commented Apr 24, 2014

Send this to /imposters

{"port":"8899",
"stubs":[
{"predicates":[
{"endsWith":{"path":"/ned/flight/status"}}
],
"responses":[{"is":{"statusCode":400,"body":null}}]}
],
"protocol":"http"}

Mountebank will not respond at all.

Wait until it comes back and do a GET and you get back a 500 and this:

TypeError: Cannot read property '_links' of null

at changeLinks (/home/developer/work/domestic-api/build_tmp/nodejs/lib/node_modules/mountebank/src/util/middleware.js:25:28)

at traverse (/home/developer/work/domestic-api/build_tmp/nodejs/lib/node_modules/mountebank/src/util/middleware.js:32:21)

at /home/developer/work/domestic-api/build_tmp/nodejs/lib/node_modules/mountebank/src/util/middleware.js:35:29

at Array.forEach (native)

at traverse (/home/developer/work/domestic-api/build_tmp/nodejs/lib/node_modules/mountebank/src/util/middleware.js:33:38)

at /home/developer/work/domestic-api/build_tmp/nodejs/lib/node_modules/mountebank/src/util/middleware.js:35:29

at Array.forEach (native)

at traverse (/home/developer/work/domestic-api/build_tmp/nodejs/lib/node_modules/mountebank/src/util/middleware.js:33:38)

at /home/developer/work/domestic-api/build_tmp/nodejs/lib/node_modules/mountebank/src/util/middleware.js:35:29

at Array.forEach (native)

DELETE will delete it and MB seems to work just fine after the delete (but, of course, the same error message comes back.

We fixed it by removing the "body".

Lee

@bbyars

This comment has been minimized.

Show comment
Hide comment
@bbyars

bbyars Apr 27, 2014

Owner

Fixed with a8777df

Owner

bbyars commented Apr 27, 2014

Fixed with a8777df

@bbyars bbyars closed this Apr 27, 2014

stkac55 added a commit to stkac55/mountebank that referenced this issue Jun 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment