vcl_error synthetic escape chars

Laurence Rowe l at lrowe.co.uk
Fri Dec 4 18:05:14 CET 2009


According to http://varnish.projects.linpro.no/wiki/VCLSyntaxStrings
you need to use 'basic' strings (not 'long' strings with the curly
brackets) for %xx escapes to work.

Laurence

2009/12/4 Joe Williams <joe at joetify.com>:
> Thanks Poul but I think I'm still doing something incorrectly.
>
> root at ubuntu:~# curl http://localhost:6081/test/adsf
> %7b"error":"not_found","reason":"missing"%7d
>
>
>         synthetic {"%7b"error":"not_found","reason":"missing"%7d
> "};
>
> Do I need to do something differently with the quotations?
>
> -Joe
>
>
> On 12/4/09 2:59 AM, Poul-Henning Kamp wrote:
>> In message<4B18488D.8030105 at joetify.com>, Joe Williams writes:
>>
>>> I am attempting to write my own error message in vcl_error and am
>>> running into an issue with escaping out "{" and "}".
>>>
>>>          synthetic {"\{"error":"not_found","reason":"missing"\}
>>>
>>> This compiles and works but when I produce the error I get the slashes
>>> in the response:
>>>
>>> root at ubuntu:~# curl http://localhost:6081/test/adsf
>>> \{"error":"not_found","reason":"missing"\}
>>>
>>> I searched around and didn't find anything, is it possible to escape out
>>> the curly braces and keep them from showing up in the response?
>>>
>> Yes I belive %7b ... %7d will work.
>>
>>
>
> --
> Name: Joseph A. Williams
> Email: joe at joetify.com
> Blog: http://www.joeandmotorboat.com/
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-misc
>



More information about the varnish-misc mailing list