Closed
Bug 285045
Opened 20 years ago
Closed 20 years ago
Set the content type on the channel when sniffing it
Categories
(Core Graveyard :: File Handling, defect)
Core Graveyard
File Handling
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8beta2
People
(Reporter: Biesinger, Assigned: Biesinger)
References
()
Details
Attachments
(1 file, 1 obsolete file)
|
1.07 KB,
patch
|
Details | Diff | Splinter Review |
after we sniffed the type, we should set it on the channel, so that nsITransfer implementations and the like only see the new type, not the internal application/x-vnd.mozilla.guess-from-ext type.
| Assignee | ||
Comment 1•20 years ago
|
||
Attachment #176509 -
Flags: superreview?(darin)
Attachment #176509 -
Flags: review?(bzbarsky)
| Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8beta2
Comment 2•20 years ago
|
||
Comment on attachment 176509 [details] [diff] [review] patch >Index: nsExternalHelperAppService.cpp ... > if (fileExtension.IsEmpty() || mimeType.IsEmpty()) { > // Extension lookup gave us no useful match > GetFromTypeAndExtension(NS_LITERAL_CSTRING(APPLICATION_OCTET_STREAM), fileExtension, > getter_AddRefs(mimeInfo)); >+ if (channel) >+ channel->SetContentType(NS_LITERAL_CSTRING(APPLICATION_OCTET_STREAM)); >+ } else if (channel) { >+ channel->SetContentType(mimeType); > } > } This code isn't perf critical, so how about writing it like this: if (fileExtension.IsEmpty() || mimeType.IsEmpty()) { // Extension lookup gave us no useful match mimeType.AssignLiteral(APPLICATION_OCTET_STREAM); GetFromTypeAndExtension(mimeType, fileExtension, getter_AddRefs(mimeInfo)); } if (channel) channel->SetContentType(mimeType); It seems more readable to me, and it probably results in less code. sr=darin either way
Attachment #176509 -
Flags: superreview?(darin) → superreview+
Comment 3•20 years ago
|
||
Comment on attachment 176509 [details] [diff] [review] patch r=bzbarsky
Attachment #176509 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Comment 4•20 years ago
|
||
thanks for the suggestion, I like this way better too.
Attachment #176509 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•20 years ago
|
||
Checking in uriloader/exthandler/nsExternalHelperAppService.cpp; /cvsroot/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp,v <-- nsExternalHelperAppService.cpp new revision: 1.284; previous revision: 1.283 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•