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

Using Rule caller restroom-mw and adding some non json data as input crashes Apiroom #253

Open
matteo-cristino opened this issue Jun 13, 2023 · 1 comment
Assignees

Comments

@matteo-cristino
Copy link
Contributor

Using any script in Apiroom that contains Rule caller restroom-mw, for example

Rule caller restroom-mw
Scenario 'ecdh': Create the key

Given nothing
When I create the ecdh key
Then print the 'keyring'

and add some data as input that is not in json format, for example

What is this?

Apiroom will crash showing a grey screen.

Testing it from restroom API, without Apiroom, it returns the following message:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>SyntaxError: Unexpected token W in JSON at position 27<br> &nbsp; &nbsp;at JSON.parse (&lt;anonymous&gt;)<br> &nbsp; &nbsp;at parse (/home/matteo/src/db_restroom/node_modules/body-parser/lib/types/json.js:89:19)<br> &nbsp; &nbsp;at /home/matteo/src/db_restroom/node_modules/body-parser/lib/read.js:128:18<br> &nbsp; &nbsp;at AsyncResource.runInAsyncScope (node:async_hooks:203:9)<br> &nbsp; &nbsp;at invokeCallback (/home/matteo/src/db_restroom/node_modules/raw-body/index.js:231:16)<br> &nbsp; &nbsp;at done (/home/matteo/src/db_restroom/node_modules/raw-body/index.js:220:7)<br> &nbsp; &nbsp;at IncomingMessage.onEnd (/home/matteo/src/db_restroom/node_modules/raw-body/index.js:280:7)<br> &nbsp; &nbsp;at IncomingMessage.emit (node:events:525:35)<br> &nbsp; &nbsp;at endReadableNT (node:internal/streams/readable:1358:12)<br> &nbsp; &nbsp;at processTicksAndRejections (node:internal/process/task_queues:83:21)</pre>
</body>
</html>
@puria
Copy link
Member

puria commented Jun 13, 2023

@matteo-cristino 🤔 thanks

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