Closed Bug 249107 Opened 20 years ago Closed 20 years ago

directory listings coming from session history (cache?) displayed in raw form

Categories

(Core :: Networking, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.8alpha2

People

(Reporter: dbaron, Assigned: Biesinger)

References

()

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

A directory listing displayed because the user presses back or forward is
displayed in raw form rather than in HTML-ized form.

Steps to reproduce:
 * load file:///
 * click on a directory
 * hit the back button

Actual results:
 * garbage that vaguely resembles the directory listing

Expected results:
 * HTML directory listing

I'm seeing this in a FF trunk build from a few days ago.  Others on IRC see it
as well.
most likely caused by bug 247607
Flags: blocking1.8a2?
Keywords: regression
Target Milestone: --- → mozilla1.8alpha2
happens on windows as well.
OS: Linux → All
so... this is caused by combining the patches from Bug 214626 with bug 247607

The former one means that docshell sets the content type of channels from
session history. the latter means that the conversion http-index-format -> html
is now triggered by the channel's content type.

Attached patch hackaround (obsolete) — Splinter Review
this patch would make this bug go away.

it'd also mean that after following an <a type="foo/bar" href="42"> link, then
going elsewhere, then going back, the 42 page may now be rendered as a
different content type...
*** Bug 249209 has been marked as a duplicate of this bug. ***
Attached patch patch v2Splinter Review
this is better. does not regress <a type="..."> session history.
Attachment #151969 - Attachment is obsolete: true
Attachment #152032 - Flags: superreview?(darin)
Attachment #152032 - Flags: review?(jst)
Status: NEW → ASSIGNED
biesi: care to explain why this patch works?
"pretty well"

more seriously:
Before, docshell got the content type off the channel, and stored it in session
history (the AddToSessionHistory part of this patch). Later, after hitting back,
the content type was read from the session history entry and set on the channel
as a content type hint (i.e. before opening it) (nsDocShell::LoadHistoryEntry)

since this is a file: uri, it then reported the content type that was set as a
hint on it as its type - text/html.
unfortunately this is really an http-index stream.

So, I'm changing it so that I'm only storing the content type _hint_ in session
history, not what the channel reported as its actual type, and am re-setting
that hint as the new hint when clicking back.
since directory listings, like most loads, do not have such a hint set, no hint
gets set, and the file channel reports http-index-format as its type, and
everything works as expected.
(In reply to comment #9)
> "pretty well"

(aw, you wrote "why" not "how". oh well)
Comment on attachment 152032 [details] [diff] [review]
patch v2

sr=darin
Attachment #152032 - Flags: superreview?(darin) → superreview+
Comment on attachment 152032 [details] [diff] [review]
patch v2

r=jst
Attachment #152032 - Flags: review?(jst) → review+
Checking in nsDocShell.cpp;
/cvsroot/mozilla/docshell/base/nsDocShell.cpp,v  <--  nsDocShell.cpp
new revision: 1.603; previous revision: 1.602
done
Checking in nsDocShell.h;
/cvsroot/mozilla/docshell/base/nsDocShell.h,v  <--  nsDocShell.h
new revision: 1.152; previous revision: 1.151
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Flags: blocking1.8a2?
v, per cvs comments.
Status: RESOLVED → VERIFIED
*** Bug 275765 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: