Closed
Bug 212530
Opened 23 years ago
Closed 23 years ago
view-source should drop almost all response headers
Categories
(Core Graveyard :: View Source, defect, P2)
Core Graveyard
View Source
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.5beta
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
()
Details
Attachments
(1 file, 1 obsolete file)
|
7.93 KB,
patch
|
timeless
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
At the moment, we drop the "refresh" header. But the "link" header can attach
stylesheets and other headers may be introduced that do weird stuff.
So we should, as suggested by hixie, clear all headers but the ones we know we want.
| Assignee | ||
Comment 1•23 years ago
|
||
| Assignee | ||
Updated•23 years ago
|
| Assignee | ||
Updated•23 years ago
|
Attachment #127634 -
Flags: superreview?(darin)
Attachment #127634 -
Flags: review?(timeless)
Attachment #127634 -
Flags: review?(timeless) → review+
Comment 2•23 years ago
|
||
so nsViewSourceChannel implements nsIHttpChannel, which means that it implements
GetResponseHeader. so, why can't it just block queries for any header other
than "Content-Type"? of course then the
NS_FORWARD_SAFE_NSIHTTPCHANNEL(mHttpChannel) could not be used :-/
| Assignee | ||
Comment 3•23 years ago
|
||
Yeah, that was sort of the motivation...
Taking bug; not sure why it wasn't assigned to me to start with.
Assignee: doron → bzbarsky
Priority: -- → P2
Target Milestone: --- → mozilla1.5beta
| Assignee | ||
Comment 4•23 years ago
|
||
Oh, we'd have to block VisitResponseHeaders too, not just GetResponseHeader....
Comment 5•23 years ago
|
||
so codesighs-wise, it'd probably be better to drop the IMPL macro and just write
the functions manually :-/ the visit method can just call the visitor once
explicitly for the value of the content-type header. the only downside is
having to explicitly write out more methods, but at least we won't ever need to
modify those methods... nsIHttpChannel is frozen afterall ;-)
| Assignee | ||
Updated•23 years ago
|
Attachment #127634 -
Flags: superreview?(darin)
| Assignee | ||
Comment 6•23 years ago
|
||
Attachment #127634 -
Attachment is obsolete: true
| Assignee | ||
Updated•23 years ago
|
Attachment #127759 -
Flags: superreview?(darin)
Attachment #127759 -
Flags: review?(timeless)
Comment 7•23 years ago
|
||
Comment on attachment 127759 [details] [diff] [review]
Use darin's preferred approach
>Index: netwerk/protocol/viewsource/src/nsViewSourceChannel.cpp
>+nsViewSourceChannel::GetRequestMethod(nsACString & aRequestMethod) {
>+ return !mHttpChannel ? NS_ERROR_NULL_POINTER :
>+ mHttpChannel->GetRequestMethod(aRequestMethod);
>+}
nit: keep the bracket style consistent.
hmm... QI to nsIHttpChannel is not possible if mHttpChannel == NULL,
so do we even need to null check mHttpChannel? hmm... actually, it
is probably wise in case the QI in OnStartRequest fails for some odd
reason.
>+NS_IMETHODIMP
>+nsViewSourceChannel::VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor) {
...
>+ aVisitor->VisitHeader(NS_LITERAL_CSTRING("content-type"), contentType);
nit: NS_LITERAL_CSTRING("Content-Type") to be consistent with nsHttpChannel.
yeah, i know the interface doesn't require this, but uhm... yeah 8)
sr=darin with those changes
Attachment #127759 -
Flags: superreview?(darin) → superreview+
Attachment #127759 -
Flags: review?(timeless) → review+
| Assignee | ||
Comment 8•23 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•21 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•