Indeed the XSS filter, which uses the same request modification pattern, has a specific method (significantly called proxyHack()) to force the new URI to be used also in the proxied case.sourcejedi wrote: and the C code relies on that:
http://mxr.mozilla.org/mozilla-central/ ... el.cpp#541
requestURI = &mSpec;
mSpec must be a private copy of channel.URI.spec. I guess it gets set before NoScript changes the URI. And this line is specific to the proxy case.
In all the most recent places where a request modification was required, I used another (less risky, but far more complex and yet hackish) way, i.e. my ChannelReplacement class, which produces an internal fake redirection and therefore has no immutability violation issue.
Unfortunately the escape_fragment feature, which was not security-critical and has been coded in a fairly relaxed and quick mood, fell back to the simplest but less correct approach and forgot about the proxyHack() thing, hence the problem at hand.
Since I'm here, rather than adding another hack I'm turning both instances to the ChannelReplacement approach -- something which was postponed for a long time because of backward compatibility concerns.
Thanks for finding out the root cause of this issue.