I am using Varnish 4.1.2, and trying to include ESI content. Sometimes, the URL for the included content might include encoded HTML entities, such as '
('
).
For example, I have the following in the HTML returned by my app for the outer shell:
<esi:include src="/esi/map/alice's%20house"/>
This should result in an ESI request for a path with 3 segments and no query string, which when fully decoded, result in:
esi
map
alice's house
The apostrophe in the third segment is HTML encoded because it is being transmitted in an HTML document. The space is URL encoded because it is part of a URL.
However, Varnish seems to not decode the HTML encoded entity before making the ESI request. It sends a request for /esi/map/alice's%20house
, which is a bad request, because &
is not legal in the path or a URL.
How can I get Varnish to handle these ESI links properly?