Closed Bug 690778 Opened 13 years ago Closed 13 years ago

Update nsFeedSniffer.cpp (Port part of Bug 589292 Add contentDisposition{Filename} properties to nsIChannel).

Categories

(SeaMonkey :: Feed Discovery and Preview, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: philip.chee, Assigned: philip.chee)

Details

Attachments

(1 file)

q.v. Core Bug 589292 Add contentDisposition{Filename} properties to nsIChannel.
Well it compiles and I don't get any errors when I run SeaMonkey but I'm not sure how to test this.
Attachment #563743 - Flags: review?(neil)
Comment on attachment 563743 [details] [diff] [review]
Patch v1.0 straight port.

>+  if (NS_SUCCEEDED(rv) && disp == nsIChannel::DISPOSITION_ATTACHMENT)
>+    return PR_TRUE;
> 
>   return PR_FALSE;
This can of course be improved upon. In fact, the whole function could be written in two lines of code should you so wish, although you would wrap them to four lines so it wouldn't really represent a saving.
Attachment #563743 - Flags: review?(neil) → review+
(In reply to Philip Chee from comment #1)
> I'm not sure how to test this.
You would need to have a server so that you could configure it to send either:
a) a feed with the correct content type (which just displays without sniffing)
b) a feed with a commonly misconfigured content type (which would get sniffed)
c) as b) but with content-disposition: attachment (which would get downloaded)
> This can of course be improved upon. In fact, the whole function could be written in
> two lines of code should you so wish, although you would wrap them to four lines so it
> wouldn't really represent a saving.
Hmm. Well if it ain't broke...

Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/3f0cb19942bc
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: