Add config setting which preserves host header
Should implement feature request #29
No, that's wrong. If you change the setting, previously cached objects will not obey the new value.
Also, please don't use spaces within brackets, and document any setting you introduce, making sure your variable is included in the variable index.
Thank you for your feedback.
Regarding caching, one solution would be to clear the cache whenever the setting is changed. The code should do something like you described in "Purging the on-disk cache" (http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/polipo.html#Purging). Another would be do document that this setting should only be used when caching is disabled. Have you had any other option in mind?
Regarding caching, one solution would be to clear the cache whenever the setting is changed. The code should do something like you described in "Purging the on-disk cache" ( http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/polipo.html#Purging ). Another would be do document that this setting should only be used when caching is disabled.
Both of these are hacks. Sorry.
Have you had any other option in mind?
A simple solution would be to add a "host" field to struct object. Add a "x-polipo-original-host" header to the on-disk cache. Generate the Host header in httpWriteObjectHeaders, but be careful, it's used both for generating HTTP traffic and for formatting disk cache objects.
I'm sure a cleaner solution is possible, but I don't see it off the top of my head.
Please be aware that even if you do it right, I still don't commit to merging your changes. It's a very specific need you're filling, and I'm still not convinced it belongs in mainline Polipo.
-- Juliusz