Hi,

I just noticed that regsub and likely regsuball will just return the untouched input string if it exceeds 57118 bytes. Is it intended to do so, performance reasons perhaps? In this case it's a custom error page with some (eye candy) embedded images and in total a bit above the mentioned size. The regsub should actually just replace a pattern with the XID, in this case simply regsub(..., "bereq\.xid", bereq.xid).
I've also a test case:

VCL:
import std;

regsub(std.fileread("/etc/varnish/error.test"), "bereq\.xid", server.hostname + "-" + bereq.xid)

File:
cat <<EOF >error.test
XID: bereq.xid
A e.g. custom error file that exceed a max. of 57118 bytes will be completely
skipped by regsub()
someembeddedimage:$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 56987 | head -n 1)
EOF

That can be reproduced with at least 4.0 and 4.1.

--
Regards,
Christian Ruppert

_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to