On Tue, Oct 15, 2013 at 5:00 PM, Paul A. Procacci
<[email protected]> wrote:
>> if (req.url ~ "^/blah") {
>> set beresp.http.Link = regsub(req.url, "^/(blah).*",
>> "<http://example.com/blah>; rel=\" + "canonical" + " ");
>> return(deliver);
>> }
>>
>
> set beresp.http.Link = regsub(req.url, '^/blah.*',
> '<http://example.com/blah>; rel="canonical" ');
>
> This maybe?
i tried single quotes initially, vcl seems to dislike single quoting
in regsub, and backslash escaping is also ineffective when trying to
print out a " character
Syntax error at
('input' Line 149 Pos 56)
set beresp.http.Link = regsub(req.url, '^/blah.*',
'<http://example.com/blah>; rel="canonical" ');
-------------------------------------------------------#-------------------------------------------------------------
Running VCC-compiler failed, exit 1
if i put "^/blah.*", in double quotes, it shifts the error over to
('input' Line 149 Pos 71)
set beresp.http.Link = regsub(req.url, "^/couples.*",
'<http://example.com/blah>; rel="canonical" ');
which is where the single quote tries to protect the double quote
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc