Skip to content

Commit

Permalink
vcc_action: Accept vmod returned strings for return(fail())
Browse files Browse the repository at this point in the history
Fixes: #4170
  • Loading branch information
walid-git committed Sep 5, 2024
1 parent 3aeff00 commit aa3d2ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions bin/varnishtest/tests/v00018.vtc
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,13 @@ varnish v1 -errvcl {Expected '.' got ';'} {
rr;
}
}

varnish v1 -vcl {
backend default none;

import debug;

sub vcl_recv {
return (fail(debug.author()));
}
}
2 changes: 1 addition & 1 deletion lib/libvcc/vcc_action.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static void
vcc_act_return_fail(struct vcc *tl)
{
SkipToken(tl, '(');
Fb(tl, 1, "VRT_fail(ctx,\n");
Fb(tl, 1, "VRT_fail(ctx, \"%%s\",\n");
tl->indent += INDENT;
vcc_Expr(tl, STRING);
tl->indent -= INDENT;
Expand Down

0 comments on commit aa3d2ec

Please sign in to comment.