Skip to content

Commit 1e39582

Browse files
committed
[sources] more fixes
1 parent 9ee75a3 commit 1e39582

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

plugins/sources/api/api.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ var utmTags = ["_ga", "_gac", "utm_source", "utm_medium", "utm_campaign","utm_te
139139
var result = [];
140140
for(var i = 0; i < data.length; i ++){
141141
var parts = urlParse.parse(common.db.decode(data[i]._id), true);
142-
if(parts.hostname && parts.query){
142+
if((parts.href || parts.hostname) && parts.query){
143+
parts.hostname = parts.hostname || parts.href.split("/")[0];
143144
for(var c in searchEngineKeyWord){
144145
if(typeof parts.query[c] != "undefined" && parts.query[c] != ""){
145146
if(typeof searchEngineKeyWord[c] === "boolean" || (typeof searchEngineKeyWord[c] === "string" && parts.hostname.indexOf(searchEngineKeyWord[c]) !== -1)){

plugins/sources/frontend/public/javascripts/countly.models.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
code = code.replace("://www.", "://");
4141
var matches = code.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
4242
var domain = matches && matches[1] || code;
43-
return domain;
43+
return domain.split("/")[0];
4444
}
4545
}
4646

0 commit comments

Comments
 (0)