mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 02:17:34 +09:00
Bug 1554098 - deduce RSS media enclosures type from extension when missing.
Tag #1273
This commit is contained in:
parent
a74473ec0b
commit
a4ab7d01df
1 changed files with 12 additions and 10 deletions
|
|
@ -452,16 +452,18 @@ function FeedEnclosure(aURL, aContentType, aLength, aTitle)
|
||||||
this.mTitle = aTitle;
|
this.mTitle = aTitle;
|
||||||
|
|
||||||
// Generate a fileName from the URL.
|
// Generate a fileName from the URL.
|
||||||
if (this.mURL)
|
if (this.mURL) {
|
||||||
{
|
try {
|
||||||
try
|
let uri = Services.io.newURI(this.mURL).QueryInterface(Ci.nsIURL);
|
||||||
{
|
this.mFileName = uri.fileName;
|
||||||
this.mFileName = Services.io.newURI(this.mURL, null, null).
|
// Determine mimetype from extension if content-type is not present.
|
||||||
QueryInterface(Ci.nsIURL).
|
if (!aContentType) {
|
||||||
fileName;
|
let contentType = Cc["@mozilla.org/mime;1"]
|
||||||
}
|
.getService(Ci.nsIMIMEService)
|
||||||
catch(ex)
|
.getTypeFromExtension(uri.fileExtension);
|
||||||
{
|
this.mContentType = contentType;
|
||||||
|
}
|
||||||
|
} catch(ex) {
|
||||||
this.mFileName = this.mURL;
|
this.mFileName = this.mURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue