Last Comment Bug 323852 - redirect after a prefetch does not include X-moz: prefetch header
: redirect after a prefetch does not include X-moz: prefetch header
Status: RESOLVED FIXED
[rft-dl]
: fixed1.8.0.2, fixed1.8.1
Product: Core
Classification: Components
Component: Networking (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: mozilla1.9alpha1
Assigned To: Darin Fisher
: benc
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-17 23:40 PST by Josh Rosenbaum
Modified: 2006-03-02 10:58 PST (History)
3 users (show)
dveditz: blocking1.8.0.2+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 patch (2.29 KB, patch)
2006-01-24 07:01 PST, Darin Fisher
cbiesinger: review+
bzbarsky: superreview+
benjamin: approval‑branch‑1.8.1+
dveditz: approval1.8.0.2+
Details | Diff | Review

Description Josh Rosenbaum 2006-01-17 23:40:30 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

I'm not entirely sure this is a bug or a design decision, but I could not find any information on this in bugzilla or via google.

I've noticed when surfing Google and it prefetches a site, that it will send the 'X-moz: prefetch' header. However, if the url it fetches is a redirect it does not include this 'X-moz' header when accessing the redirect page.


Reproducible: Always

Steps to Reproduce:
You should be able to just setup a prefetched link in some html that points to a url that redirects to another page. On the second access in the prefetch process you will see that 'X-moz: prefetch' is not included in the header.
Something like:
<link rel="prefetch" href="http://www.xyz.com/">
and let's say http://www.xyz.com/ redirects to: http://www.xyz.com/mypage.html
Actual Results:  
No X-moz header sent for mypage.html.

Expected Results:  
I think the X-moz header might need to be there.
Comment 1 Darin Fisher 2006-01-24 07:01:14 PST
Created attachment 209444 [details] [diff] [review]
v1 patch

Simple patch.  I also noticed that nsPrefetchService::mCurrentChannel is not updated when we process a redirect.  I think it should be updated since nsPrefetchService::StopProcessing calls Cancel on mCurrentChannel.
Comment 2 Christian :Biesinger (don't email me, ping me on IRC) 2006-01-24 16:13:06 PST
Comment on attachment 209444 [details] [diff] [review]
v1 patch

+    // HTTP request headers are not automatically forwarded to the new channel.

maybe there should be a way to do that though... but ok, r=biesi
Comment 3 Darin Fisher 2006-01-24 16:48:00 PST
> maybe there should be a way to do that though... but ok, r=biesi

yeah, this is not the first time we've hit a problem like this.
Comment 4 Darin Fisher 2006-01-24 16:48:48 PST
fixed-on-trunk
Comment 5 Darin Fisher 2006-01-31 07:01:36 PST
fixed1.8.1
Comment 6 Daniel Veditz [:dveditz] 2006-02-22 01:08:58 PST
Comment on attachment 209444 [details] [diff] [review]
v1 patch

approved for 1.8.0 branch, a=dveditz
Comment 7 Darin Fisher 2006-02-23 11:39:54 PST
fixed1.8.0.2
Comment 8 Dave Liebreich [:davel] 2006-03-02 10:58:02 PST
Marking [rft-dl] (ready for testing in Firefox 1.5.0.2 release candidates).  Whoever tests this, please attach the html page with the prefetch link to this bug as a testcase

Note You need to log in before you can comment on or make changes to this bug.