Skip to content

Commit

Permalink
fix: remove cont and let
Browse files Browse the repository at this point in the history
  • Loading branch information
divyam234 committed May 13, 2024
1 parent 3422e5a commit 7f1e3dc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/scripts/services/aria2RpcService.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,16 @@
addUri: function (context, returnContextOnly) {
var urls = context.task ? context.task.urls : null;
var options = buildRequestOptions(context.task ? context.task.options : {}, context);
let proxyRegex= ariaNgSettingService.getHostProxyPattern().trim()
var proxyRegex= ariaNgSettingService.getHostProxyPattern();
if (proxyRegex) {
let patterns = proxyRegex.split('\n')
for (let pattern of patterns) {
pattern = pattern.trim()
if (pattern) {
const lastIndex = pattern.lastIndexOf('|');
var patterns = proxyRegex.split('\n');
for (var i = 0; i < patterns.length; i++) {
patterns[i] = patterns[i].trim()
if (patterns[i]) {
var lastIndex = patterns[i].lastIndexOf('|');
if (lastIndex === -1) continue
const hostRegex = pattern.slice(0, lastIndex);
const httpProxy = pattern.slice(lastIndex + 1);
var hostRegex = patterns[i].slice(0, lastIndex);
var httpProxy = patterns[i].slice(lastIndex + 1);
if (urls[0].match(hostRegex)) options['all-proxy'] = httpProxy

}
Expand Down

0 comments on commit 7f1e3dc

Please sign in to comment.