Incorrect handling of JSON null values #3

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

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
Owner
bbyars commented Apr 27, 2014

Fixed with a8777df

@bbyars bbyars closed this Apr 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment