varnish-cache
varnish-cache copied to clipboard
VCC handling missing for `if (resp.body)`
vcl:
sub vcl_synth {
if (resp.body) {
set resp.status = 400;
}
}
error:
**** v1 CLI RX|Message from VCC-compiler:
**** v1 CLI RX|Assert error in vcc_expr0(), vcc_expr.c line 1422:
**** v1 CLI RX| Condition((*e)->fmt != BODY) not true.
**** v1 CLI RX|Running VCC-compiler failed, signal 6
**** v1 CLI RX|VCL compilation failed
Are we ready to just return resp.body
as STRANDS
or BLOB
?
Good catch!
That would suppose a workspace allocation, not sure we want to return anything. However, there could be a property or method to grab the length of the body:
sub vcl_synth {
if (resp.body.len != 0) {
set resp.status = 400;
}
}
This ticket is parked, pending VDD discussion about synth/error and body filters.