Using Twig's replace filter with getURL() I have a template that displays in both http and https environments. When pulling my images for the https environment I need to be able to change the URL to https:// from http://. I tried

{{ gist.gistImage.first().getUrl('gistUnit')|replace({'http': https}) }}


based on the documentation here twig.sensiolabs.org/doc/filters/replace.html

Not working. Is this because getURL() gets processed after the filter?
Try using:

{{ gist.gistImage.first().getUrl('gistUnit')|replace({'http': 'https'}) }}