Closed Bug 83229 Opened 24 years ago Closed 24 years ago

Referer: pref names in code and all.js do not match

Categories

(Core :: Networking: HTTP, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: mozilla, Assigned: gerv)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9) Gecko/20010505 BuildID: 2001050515 Mozilla doesn't send a referer field for graphics it requestes to loads. Other browsers send the page that the graphic is referenced in as the referer. This breaks my counter app, which takes the referer and determines what value to increment. An example is at http://www.weaverling.org/atc/ under the Amtrak sign. If it says error, it means that the referer field on the request is NULL. This works from all other browsers I've tried, but not mozilla. Reproducible: Always Steps to Reproduce: 1.Load any page with graphics 2.View web server access logs, look at referer field 3.Field is empty Actual Results: Referer field not sent with image requests Expected Results: Referer field should be sent by default with image requests from pages Additional info from Gervase Markham <gervase.markham@univ.ox.ac.uk> from article 3B1417CD.E80BDC77@univ.ox.ac.uk in netscape.public.mozilla.qa.browser: Well, doh us. We have a pref for this: pref("network.sendRefererHeader",2); // 0=don't send any, 1=send only on clicks, 2=send on image requests as well But the code says: http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpHandler.c pp 922 if (bChangedAll || PL_strcmp(pref, "network.http.sendRefererHeader") == 0) 923 mPrefs->GetIntPref("network.http.sendRefererHeader", (PRInt32 *) &mReferrerLevel); However, the default is -1 ("All") so there's something a bit weird going on here. File a bug in Networking: HTTP, include the above text, and CC me :-)
Dup of Bug 74284? Not sending referer on any embedded objects. See also Bug 76723 which matches this better, and is a dup of 74284.
Note that bug 74284 is fixed as of May 5, while this bug is present in a May 15th build. Setting status to NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
2001050515 is a May 5th build, and it's from the 0.9 branch. I suggest trying it with a recent nightly and seeing if it still is a problem.
Look, whether it's still a problem or not, we're attempting to read a non-existent pref. We should fix that, and _then_ see if it's still a problem. This is a one-line fix to all.js. If no-one else bothers, I'll do it on Thursday. Gerv
+regression So this feature works now, but the pref is set wrong? Can people fix this w/ the workaround of hacking prefs.js, so they can verify that bug 74284 is fixed?
Keywords: regression
Summary: No referer sent on image requests → Referer: not sent for <IMG> URLs, v2 (prefs problem)
I just downloaded a fresh copy of build 2001053004 (er, from today) and installed it on a fresh, never-been-touched-by-mozilla install, tried it, and the default setup works fine. Referer is sent with image requests. Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9+) Gecko/20010530 I can't speak for whether or not the prefs to turn that behavior off or not works now, but the default behavior is "sane" at least.
> So this feature works now, but the pref is set wrong? The wrong pref is set. There's a subtle difference :-) Even if we are currently Doing The Right Thing, which is possible, this bug should remain open to fix that problem. Gerv
It amazes me that this could happen. Did the implementor not do _any_ testing? As far as I can tell, this stuff was checked in by Gagan in bug 1582, but there's no patch attached and no indication of who reviewed it. <sigh>. The evidence in the C++ code disappeared with the HTTP rearch. Patch on its way. Looking for r= and rs=. Once we've fixed the misnamed pref, we will then check whether it actually works :-) Gerv
Assignee: neeti → gervase.markham
Summary: Referer: not sent for <IMG> URLs, v2 (prefs problem) → Referer: pref names in code and all.js do not match
Target Milestone: --- → mozilla0.9.2
Attached patch Patch v.1Splinter Review
r=bbaetz The actual problem isn't really the misnamed pref, since the code (quite correctly) doesn't error out if the pref isn't found, and manually setting the correct pref works fine. Its just a documentation issue - technically, nothing is broken. However, someone else just reported this, so it would be nice to get into the branch, if possible. ccing darin for an rs= IIRC, pav fixed the image referrer thing some time in the last month, and I just tested now that it works.
*** Bug 83888 has been marked as a duplicate of this bug. ***
sr=darin
a= asa@mozilla.org for checkin to the trunk. (on behalf of drivers)
Checked in on the trunk. Gerv
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified fixed.
Status: RESOLVED → VERIFIED
QA Contact: benc → junruh
John: what steps did you use to verify this?
I used the test URL at the top of the page.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: