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

Incorrect handling of JSON null values #3

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

Incorrect handling of JSON null values #3

bbyars opened this issue Apr 24, 2014 · 1 comment

Comments

@bbyars
Copy link
Owner

@bbyars 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 added a commit that referenced this issue Apr 27, 2014
@bbyars
Copy link
Owner Author

@bbyars 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.