aelvan / VarnishPurge-Craft

Craft plugin for purging Varnish when elements are saved.
MIT License
33 stars 11 forks source link

Synchronize URLs with Craft's addTrailingSlashesToUrls setting #3

Closed timkelty closed 8 years ago

timkelty commented 8 years ago

Normally we could just pass everything through UrlHelper::getUrl()...but that bypasses the addTrailingSlashesToUrls logic if the originating request comes from the cp, which it does in this case.

This circumvented an issue where I had a addTrailingSlashesToUrls set true, as well as an htaccess rule to add slashes to any incoming requests without them.

The result was my purge requests always going to the non-slashed urls, but I was always serving my slashed ones (either via craft generated links, or handled by the htaccess rewrite).

aelvan commented 8 years ago

Thanks for contributing!!