Comment 197 for bug 113201

Revision history for this message
In , Jmuizelaar (jmuizelaar) wrote :

(In reply to comment #116)
> After all the work I'd done to make absolutely sure that this passed a full run
> of mochitests, multiple times, I checked it in. Then I discovered that it
> caused one of the mochi*chrome* tests to fail:
>
> http://lxr.mozilla.org/seamonkey/source/content/base/test/chrome/test_bug421622.xul
>
> I don't know why, offhand - SetupReplacementChannel certainly does transfer the
> referer.

The problem appears to be that test_bug421622.xul uses setRequestHeader to set the referer and so nsHttpChannel::mReferrer is not set and thus not copied over by SetupReplacementChannel.

I've attached a patch that adds a hack to make the mochichrome test pass, but also adds a new mochitest that uses a custom header that is not propagated by SetupReplacementChannel.

I'd guess that both test_bug421622.xul and the new test would currently fail if a proxy is setup so that DoReplaceWithProxy...SetupReplacementChannel etc. is called like it is after this patch is applied. However, I haven't confirmed this.