Skip to content

Commit

Permalink
refactor: code
Browse files Browse the repository at this point in the history
  • Loading branch information
avwo committed May 26, 2018
1 parent 5f81499 commit 4ba0c9a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/https/ca.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ function getDomain(hostname) {
}

exports.getDomain = getDomain;
exports.hasCustomCert = function(hostname) {

exports.existsCustomCert = function(hostname) {
if (!customCertCount) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/https/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ var ca = require('./ca');
serverAgent.createCertificate = ca.createCertificate;
exports.serverAgent = serverAgent;
exports.getDomain = ca.getDomain;
exports.hasCustomCert = ca.hasCustomCert;
exports.existsCustomCert = ca.existsCustomCert;
exports.getRootCAFile = ca.getRootCAFile;
4 changes: 2 additions & 2 deletions lib/tunnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var util = require('./util');
var rules = require('./rules');
var socketMgr = require('./socket-mgr');
var rulesUtil = require('./rules/util');
var hasCustomCert = require('./https/util').hasCustomCert;
var existsCustomCert = require('./https/util').existsCustomCert;
var pluginMgr = require('./plugins');
var config = require('./config');

Expand Down Expand Up @@ -52,7 +52,7 @@ function tunnelProxy(server, proxy) {
};
var isEnableIntercept = function() {
return policy === 'intercept' || (!isIPHost && rulesUtil.properties.get('interceptHttpsConnects'))
|| filter.https || filter.capture || filter.intercept || hasCustomCert(hostname);
|| filter.https || filter.capture || filter.intercept || existsCustomCert(hostname);
};
var isIntercept = function() {
return isLocalUIUrl || (!isDisabeIntercept() && isEnableIntercept());
Expand Down

0 comments on commit 4ba0c9a

Please sign in to comment.