Allow for empty url
This commit is contained in:
Родитель
1ec86241a2
Коммит
c65b554383
|
@ -83,11 +83,12 @@ UrlClassifier.prototype = {
|
|||
this._results = {};
|
||||
try {
|
||||
// submit url+title to workers
|
||||
let uri = NetUtil.newURI(url);
|
||||
let theUrl = url || "http://www.no_such_domain_ever.hmm";
|
||||
let uri = NetUtil.newURI(theUrl);
|
||||
let host = getPlacesHostForURI(uri);
|
||||
let message = {};
|
||||
message.message = "getInterestsForDocument";
|
||||
message.url = url;
|
||||
message.url = theUrl;
|
||||
message.title = title || "";
|
||||
message.host = host;
|
||||
message.path = uri["path"];
|
||||
|
|
|
@ -42,7 +42,7 @@ exports["test url classifier"] = function test_UrlClassifier(assert, done) {
|
|||
});
|
||||
|
||||
// classify only the text
|
||||
results = yield urlClassifier.classifyPage("http://www.xyz.com", "iphone, ipad, apple, product, phone");
|
||||
results = yield urlClassifier.classifyPage(null, "iphone, ipad, apple, product, phone");
|
||||
testUtils.isIdentical(assert, results["edrules"].results,
|
||||
[{"type":"rules","interests":[]},
|
||||
{"type":"keywords","interests":["Apple"]},
|
||||
|
|
Загрузка…
Ссылка в новой задаче