In a reverse proxy setup I encountered a problem with user directories; it seemed like every now and then users got redirected to http://host/%7Euser instead of the correct http://host/~user. After some debugging I figured out that the frontend mod_proxy was "canonicalizing" URLs, thereby encoding ~ as %7E. This would not be an issue but for lots of backend server software that relied on the URL passed to the backend server to be the same as the one the user saw in their browsers. Now, this is of course a bad assumption *but* I don't really know why the canonicalization happens in the first place, or even why ~ is not considered a safe character. I have attached a patch that simply adds '~' to the set of "reserved" characters for modules/proxy/proxy_util.c:ap_proxy_canonenc. It does the job on my site. Is there any reason not to apply it? Note: I tried to subscribe to apache-users@ to ask around for other people experiencing this bug bug the list never confirmed my emails...
Created attachment 17536 [details] patch to reserve ~ character in mod_proxy Here is the trivial patch.
well.. guess nobody's interested either way?
(In reply to comment #2) > well.. guess nobody's interested either way? ~ may or may not be a reserved character according to which edition of the RFC you read. Encoding it as %7E is a safe option. I don't see any strong reason to apply your patch (but feel free to try and convince me). Neither do I see any reason to close this report - it's marked as PatchAvailable for the benefit of anyone who wants it.
I changed my mind since my previous comment, and I've committed this to /trunk/. Thanks:-)
Many thanks! That's one less customized package to maintain!
Fixed in 2.2 branch (r571456). Closing.