Skip to content

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Umit Coskun Aydinoglu committed Oct 12, 2023
1 parent 62926ad commit 3e8786a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
17 changes: 9 additions & 8 deletions api/utils/countly-request/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const got = require('got');
const FormData = require('form-data');
const plugins = require('../../../plugins/pluginManager.js');
const {HttpsProxyAgent,HttpProxyAgent} = require('hpagent');
const {HttpsProxyAgent, HttpProxyAgent} = require('hpagent');

var initParams = function(uri, options, callback) {

Expand Down Expand Up @@ -33,21 +33,21 @@ var initParams = function(uri, options, callback) {
params.callback = callback || params.callback;

var config = plugins.getConfig("security");

if (config && config.proxy_hostname) {
if (!params.options) {
params.options = {}; // Create options object if it's undefined
}

const proxyType = config.proxy_type || "https";
const proxyUrlBase = `${proxyType}://${config.proxy_hostname}:${config.proxy_port}`;

let proxyUrl = proxyUrlBase;

if (config.proxy_username && config.proxy_password) {
proxyUrl = `${proxyType}://${config.proxy_username}:${config.proxy_password}@${config.proxy_hostname}:${config.proxy_port}`;
}

const agentOptions = {
keepAlive: true,
keepAliveMsecs: 1000,
Expand All @@ -56,12 +56,13 @@ var initParams = function(uri, options, callback) {
scheduling: 'lifo',
proxy: proxyUrl,
};

if (proxyType === "https") {
params.options.agent = {
https: new HttpsProxyAgent(agentOptions)
};
} else {
}
else {
params.options.agent = {
http: new HttpProxyAgent(agentOptions)
};
Expand Down
10 changes: 5 additions & 5 deletions plugins/plugins/frontend/public/javascripts/countly.views.js
Original file line number Diff line number Diff line change
Expand Up @@ -1119,14 +1119,14 @@

app.configurationsView.registerInput("security.proxy_password", {input: "el-input", attrs: {type: "textarea", rows: 1}});

app.configurationsView.registerInput("security.proxy_type",{
input : "el-select",
app.configurationsView.registerInput("security.proxy_type", {
input: "el-select",
attrs: {},
list: [
{value: 'https',label:'https'},
{value: 'http',label:'http'}
{value: 'https', label: 'https'},
{value: 'http', label: 'http'}
]
})
});


app.configurationsView.registerInput("api.reports_regenerate_interval", {
Expand Down

0 comments on commit 3e8786a

Please sign in to comment.