polipo icon indicating copy to clipboard operation
polipo copied to clipboard

Add config setting which preserves host header

Open stirnim opened this issue 11 years ago • 3 comments

Should implement feature request #29

stirnim avatar Jun 17 '14 13:06 stirnim

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.

jech avatar Jun 17 '14 20:06 jech

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?

stirnim avatar Jun 23 '14 13:06 stirnim

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

jech avatar Jun 24 '14 21:06 jech