Closed Bug 450175 Opened 16 years ago Closed 16 years ago

check propagation of LOAD_CHECK_OFFLINE_CACHE during redirects

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dcamp, Assigned: mayhemer)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file)

As mentioned in bug 442806, the LOAD_CHECK_OFFLINE_CACHE flag is passed along after a redirect. This could lead to the LOAD_CHECK_OFFLINE_CACHE flag being passed to a load that does not have the offline-app permission.
Flags: blocking1.9.1?
Assignee: dcamp → honzab
Attached patch v1 (deleted) — Splinter Review
This adds to nsDocShell (the same class that sets LOAD_CHECK_OFFLINE_CACHE flag during initial load) check for new URI having offline application permission on redirect.
Attachment #336392 - Flags: review?(bzbarsky)
Attachment #336392 - Flags: review?(bzbarsky) → review?(cbiesinger)
Comment on attachment 336392 [details] [diff] [review] v1 I'm not at all sure that this notification fires at the right time to do this (or at least is guaranteed to do so). Hooking into the actual "we're setting up the redirect channel" notification seems like it would be better, but really Christian is the one who knows about this stuff...
(In reply to comment #2) > (From update of attachment 336392 [details] [diff] [review]) > I'm not at all sure that this notification fires at the right time to do this > (or at least is guaranteed to do so). Hooking into the actual "we're setting > up the redirect channel" notification seems like it would be better, but really > Christian is the one who knows about this stuff... The callback is invoked right from the place "we're setting up the redirect channel". I put the code to the callback - the class - that originally sets the LOAD_CHECK_OFFLINE_CACHE on the original channel. As Dave Camp said, nsDocShell has to take care of this flag, not the channel itself.
(In reply to comment #2) > (From update of attachment 336392 [details] [diff] [review]) > I'm not at all sure that this notification fires at the right time to do this > (or at least is guaranteed to do so). Hooking into the actual "we're setting > up the redirect channel" notification seems like it would be better, but really > Christian is the one who knows about this stuff... Yeah, OnChannelRedirect directly calls this. This should be fine.
Comment on attachment 336392 [details] [diff] [review] v1 + aNewChannel->SetLoadFlags + (loadFlags & ~nsICachingChannel::LOAD_CHECK_OFFLINE_CACHE); I think more common style is to put the ( on the previous line
Attachment #336392 - Flags: review?(cbiesinger) → review+
I wonder if it would be a safer contract to have the channel not propagate LOAD_CHECK_OFFLINE_CACHE by default, and require docshell to set it appropriately in its redirect handler.
That might not be a bad idea.
Flags: blocking1.9.1? → blocking1.9.1+
This fix (not propagating LOAD_CHECK_OFFLINE_CACHE on a redirect) was included as part of the patch for 445544.
Status: NEW → RESOLVED
Closed: 16 years ago
Depends on: 445544
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: