mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 06:22:33 +00:00
Bug 341908: make sure we deal with invalid templates correctly, r=mconnor
This commit is contained in:
parent
cf43eef68f
commit
807a83f6fd
@ -707,8 +707,24 @@ function EngineURL(aType, aMethod, aTemplate) {
|
||||
|
||||
this.type = type;
|
||||
this.method = method;
|
||||
this.template = aTemplate;
|
||||
this.params = [];
|
||||
|
||||
var templateURI = makeURI(aTemplate);
|
||||
ENSURE(templateURI, "new EngineURL: template is not a valid URI!",
|
||||
Cr.NS_ERROR_FAILURE);
|
||||
|
||||
switch (templateURI.scheme) {
|
||||
case "http":
|
||||
case "https":
|
||||
// Disable these for now, see bug 295018
|
||||
// case "file":
|
||||
// case "resource":
|
||||
this.template = templateURI.spec;
|
||||
break;
|
||||
default:
|
||||
ENSURE(false, "new EngineURL: template uses invalid scheme!",
|
||||
Cr.NS_ERROR_FAILURE);
|
||||
}
|
||||
}
|
||||
EngineURL.prototype = {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user