mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-06 14:56:23 +01:00
1 parent
75df5f8094
commit
29d2d0ec62
1 file changed
+2
-1
@@ -39,7 +39,6 @@ export const plugin: Plugin = {
|
|||||||
if (httpRequest == null) {
|
if (httpRequest == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const renderedHttpRequest = await ctx.httpRequest.render({ httpRequest, purpose: args.purpose });
|
|
||||||
|
|
||||||
const responses = await ctx.httpResponse.find({ requestId: httpRequest.id, limit: 1 });
|
const responses = await ctx.httpResponse.find({ requestId: httpRequest.id, limit: 1 });
|
||||||
|
|
||||||
@@ -57,6 +56,8 @@ export const plugin: Plugin = {
|
|||||||
|
|
||||||
// Send if no responses and "smart," or "always"
|
// Send if no responses and "smart," or "always"
|
||||||
if ((behavior === 'smart' && response == null) || behavior === 'always') {
|
if ((behavior === 'smart' && response == null) || behavior === 'always') {
|
||||||
|
// NOTE: Render inside this conditional, or we'll get infinite recursion (render->render->...)
|
||||||
|
const renderedHttpRequest = await ctx.httpRequest.render({ httpRequest, purpose: args.purpose });
|
||||||
response = await ctx.httpRequest.send({ httpRequest: renderedHttpRequest });
|
response = await ctx.httpRequest.send({ httpRequest: renderedHttpRequest });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user