Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like purge to issue a request to purge a resource for both https and http using the X-Forwarded-Proto header. Has anyone tried to add support for custom headers? If not, where would be the best place to start?
Comment | File | Size | Author |
---|---|---|---|
#1 | support-x-forwarded-proto-and-custom-headrs-2446191-D7.patch | 386 bytes | ben.bunk |
Comments
Comment #1
ben.bunk CreditAttribution: ben.bunk commentedI decided to take a stab at implementing a solution to this so the attached patch adds a drupal_alter call on the purge_requests array just before passing it on for processing with curl. Below is an implementation of the drupal_alter to duplicate all the purge requests and add the x-forwarded-proto header to the second set although any headers could be added at this point.
Comment #2
chriso CreditAttribution: chriso commentedThis patch fits the 1.x branch not the 2.x branch -- but I'm using it, together with your exact example since it makes for pain-free purging of Varnish via Pound. Cool stuff, thanks!
It is a bit of a duplicate of #1888866: Allow other modules to add hostnames and headers for purge requests though; that issue remains as a feature request for the 7.x-2.x branch. Marking this 7.x-1.x patch as RTBC.