mockserver icon indicating copy to clipboard operation
mockserver copied to clipboard

Wrong arguments passed to the `evalHandler`

Open endlessoblivion opened this issue 4 years ago • 0 comments

Passing the context to evalHandler (contrary to its signature) makes the request parameter unreachable in the evaluated code.

https://github.com/namshi/mockserver/blob/39b3e8df58659214a2ecd48aa1d07983bdbdb2c4/handlers/evalHandler.js#L1 https://github.com/namshi/mockserver/blob/39b3e8df58659214a2ecd48aa1d07983bdbdb2c4/mockserver.js#L84 https://github.com/namshi/mockserver/blob/39b3e8df58659214a2ecd48aa1d07983bdbdb2c4/mockserver.js#L110

So the following doesn't work, since request has here the value of context instead:

#eval request.body;

endlessoblivion avatar Jul 30 '21 17:07 endlessoblivion