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
Config file does not allow nested stringify functions #183
Comments
Fixed in 0e02d68 |
hey Brandon, I am still facing this issue. Nested stringily failing for me with error something like this
|
Btw, this is how you can recreate the problem templates/originServer.ejs
templates/apiStub.ejs
templates/GET-request.ejs |
What version of mountebank are you using?
mb --version
Also, I'm assuming you get the error on startup, correct? Assuming that's
the case, I couldn't reproduce with the latest version, so I imagine the
problem is that you're simply on an older version.
-Brandon
…On Thu, Sep 21, 2017 at 7:38 AM, Rohit ***@***.***> wrote:
Btw, this is how you can recreate the problem
$mb --configfile templates/originServer.ejs --allowInjection
templates/originServer.ejs
{
"port": 5555,
"protocol": "http",
"name": "origin",
"stubs": [
{
"responses": [{ "inject": "<%- stringify(filename, 'apiStub.ejs') %>" }]
}
]
}
templates/apiStub.ejs
function (request, state, logger) {
logger.info('apiStub.ejs Called');
var apiKey = request.method + '-' + request.path;
logger.info(apiKey);
return {
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(<%- stringify(filename, 'GET-request.ejs') %>)
};
}
templates/GET-request.ejs
{ count: 10 }
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#183 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAESvyMs5ZteLaT5obZZdLR2naJQCMd7ks5skliygaJpZM4LYwn7>
.
|
Hi Brendan, I get this error when I call the port 5555, instead startup. |
Thanks for the extra info. I identified the bug and fixed it - it has to do
with an extra newline at the end of the nested stringify funciton. I aim to
release the next version this week.
…On Sun, Sep 24, 2017 at 6:30 AM, Rohit ***@***.***> wrote:
Hi Brendan, I get this error when I call the port 5555, instead startup.
Here is what I am running on my laptop
~ $mb --version
1.12.0
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#183 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAESv0nwXuDCLsursno19t9Zr61C6lxDks5slj1EgaJpZM4LYwn7>
.
|
Hi Brendan, has this been fixed? I am facing the same issue, I am able to replicate the issue with @rohgoyal imposter and ejs file. I am using 1.14.1 Thanks! |
Hi @leogtzr. Interesting...I can't reproduce it. I thought I fixed it in v1.13.0 (see #293 and the corresponding commit). A local test using @rohgoyal 's files works for me, returning a body of "{"count":10}" when calling the imposter on port 5555, and logging the "apiStub.ejs Called". What O/S are you using? |
Hello, sorry for the late response: I am currently using:
[0 [17:26][leo@~]$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
[0 [17:26][leo@~]$
I will see if I can reproduce it this weekend and send you over the files.
Thank you!
El lun., 4 jun. 2018 a las 14:05, Brandon Byars (<notifications@github.com>)
escribió:
… Hi @leogtzr <https://github.com/leogtzr>. Interesting...I can't reproduce
it. I thought I fixed it in v1.13.0 (see #293
<#293> and the corresponding
commit). A local test using @rohgoyal <https://github.com/rohgoyal> 's
files works for me, returning a body of "{"count":10}" when calling the
imposter on port 5555, and logging the "apiStub.ejs Called".
What O/S are you using?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#183 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABJ-QTZcBYV061U63pUPmROeiY58Zslwks5t5ZMAgaJpZM4LYwn7>
.
--
* Leonardo Gutiérrez R.*
|
OK thanks, keep me posted.
…On Fri, Jun 8, 2018 at 6:27 PM, Leo Gutiérrez Ramírez < ***@***.***> wrote:
Hello, sorry for the late response: I am currently using:
[0 [17:26][leo@~]$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
[0 [17:26][leo@~]$
I will see if I can reproduce it this weekend and send you over the files.
Thank you!
El lun., 4 jun. 2018 a las 14:05, Brandon Byars ***@***.***
>)
escribió:
> Hi @leogtzr <https://github.com/leogtzr>. Interesting...I can't
reproduce
> it. I thought I fixed it in v1.13.0 (see #293
> <#293> and the corresponding
> commit). A local test using @rohgoyal <https://github.com/rohgoyal> 's
> files works for me, returning a body of "{"count":10}" when calling the
> imposter on port 5555, and logging the "apiStub.ejs Called".
>
> What O/S are you using?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#183 (comment)
>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABJ-
QTZcBYV061U63pUPmROeiY58Zslwks5t5ZMAgaJpZM4LYwn7>
> .
>
--
* Leonardo Gutiérrez R.*
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#183 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAESvxhsiYZQnQshRQPcg4Kt3hl7XlV5ks5t6whhgaJpZM4LYwn7>
.
|
See https://groups.google.com/forum/#!topic/mountebank-discuss/6ShnSHx-GAc
and
https://gist.github.com/zot24/3cf6df65c8ae3e63c2deabc4ed7174b9
The text was updated successfully, but these errors were encountered: