mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 06:49:50 +02:00
@@ -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