Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): provider updates on macOS use the system proxy #25747

Closedjuliusmarmingewants to merge 9 commits intomain fromrefs/pull/25747/headopened View on GitHub

Showing 4 changed files with 204 additions and 0 deletions (loading 2).

x
0 of 4 viewed, 4 left
89 additions and 0 deletionsapps/server/src/provider/macosSystemProxy.test.tsAdded
View file
@@ -0,0 +1,89 @@
+import { assert, describe, it } from "@effect/vitest";
+​
+import { parseScutilProxy } from "./macosSystemProxy.ts";
+​
+const dictionary = (...lines: ReadonlyArray<string>) =>
+ ["<dictionary> {", ...lines.map((line) => ` ${line}`), "}", ""].join("\n");
+​
+describe("parseScutilProxy", () => {
+ it("ignores disabled, incomplete, SOCKS and PAC proxies", () => {
+ assert.deepStrictEqual(
+ parseScutilProxy(
+ dictionary(
+ "HTTPEnable : 0",
+ "HTTPProxy : 10.0.0.1",
+ "HTTPPort : 3128",
+ "HTTPSEnable : 1",
+ "HTTPSProxy : 10.0.0.1",
+ "ProxyAutoConfigEnable : 1",
+ "ProxyAutoConfigURLString : http://wpad/proxy.pac",
+ "SOCKSEnable : 1",
+ "SOCKSPort : 1080",
+ "SOCKSProxy : 10.0.0.1",
+ ),
+ ),
+ {},
+ );
+ assert.deepStrictEqual(parseScutilProxy(""), {});
+ });
+​
+ it.each([