Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Add config setting which preserves host header #30

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stirnim
Copy link

@stirnim stirnim commented Jun 17, 2014

Should implement feature request #29

@jech
Copy link
Owner

jech commented Jun 17, 2014

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 jech mentioned this pull request Jun 19, 2014
@stirnim
Copy link
Author

stirnim commented Jun 23, 2014

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?

@jech
Copy link
Owner

jech commented Jun 24, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants