summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-06 15:51:03 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-06 15:51:03 +0200
commita4a7a75cd70d41e45f12afbaba0b0bb3faa5dfd3 (patch)
tree826b259bd54da27d738f6ead4be4cca017dfb78d
parente7cee21543398234962f8f5cf3a022f3e2c15052 (diff)
Bypassing proxy on URL open with "noproxy"
IssueID #25
-rw-r--r--src/app.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/app.c b/src/app.c
index 354d34d6..37279391 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1015,11 +1015,13 @@ iBool handleCommand_App(const char *cmd) {
1015 } 1015 }
1016 else if (equal_Command(cmd, "open")) { 1016 else if (equal_Command(cmd, "open")) {
1017 const iString *url = collectNewCStr_String(suffixPtr_Command(cmd, "url")); 1017 const iString *url = collectNewCStr_String(suffixPtr_Command(cmd, "url"));
1018 const iBool noProxy = argLabel_Command(cmd, "noproxy");
1018 iUrl parts; 1019 iUrl parts;
1019 init_Url(&parts, url); 1020 init_Url(&parts, url);
1020 if (equalCase_Rangecc(parts.scheme, "mailto") || 1021 if (equalCase_Rangecc(parts.scheme, "mailto") ||
1021 (isEmpty_String(&d->prefs.httpProxy) && (equalCase_Rangecc(parts.scheme, "http") || 1022 ((noProxy || isEmpty_String(&d->prefs.httpProxy)) &&
1022 equalCase_Rangecc(parts.scheme, "https")))) { 1023 (equalCase_Rangecc(parts.scheme, "http") ||
1024 equalCase_Rangecc(parts.scheme, "https")))) {
1023 openInDefaultBrowser_App(url); 1025 openInDefaultBrowser_App(url);
1024 return iTrue; 1026 return iTrue;
1025 } 1027 }