opencode-studio-server 1.14.5 → 1.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -0
- package/package.json +1 -1
- package/proxy-manager.js +7 -0
package/index.js
CHANGED
|
@@ -2510,6 +2510,10 @@ app.post('/api/proxy/login', async (req, res) => {
|
|
|
2510
2510
|
}
|
|
2511
2511
|
});
|
|
2512
2512
|
|
|
2513
|
+
app.get('/api/proxy/accounts', (req, res) => {
|
|
2514
|
+
res.json(proxyManager.listAccounts());
|
|
2515
|
+
});
|
|
2516
|
+
|
|
2513
2517
|
app.get('/api/proxy/config', (req, res) => {
|
|
2514
2518
|
res.json(proxyManager.loadProxyConfig());
|
|
2515
2519
|
});
|
package/package.json
CHANGED
package/proxy-manager.js
CHANGED
|
@@ -54,6 +54,8 @@ const loadProxyConfig = () => {
|
|
|
54
54
|
// Default config
|
|
55
55
|
const defaultConfig = {
|
|
56
56
|
port: 8317,
|
|
57
|
+
cors: true,
|
|
58
|
+
"allow-origin": "*",
|
|
57
59
|
"auth-dir": PROXY_AUTH_DIR,
|
|
58
60
|
"management-key": "",
|
|
59
61
|
routing: { strategy: "round-robin" },
|
|
@@ -74,6 +76,11 @@ const loadProxyConfig = () => {
|
|
|
74
76
|
config['management-key'] = "";
|
|
75
77
|
saveProxyConfig(config);
|
|
76
78
|
}
|
|
79
|
+
if (config && config.cors === undefined) {
|
|
80
|
+
config.cors = true;
|
|
81
|
+
config['allow-origin'] = "*";
|
|
82
|
+
saveProxyConfig(config);
|
|
83
|
+
}
|
|
77
84
|
return config;
|
|
78
85
|
} catch (e) {
|
|
79
86
|
console.error("Failed to load proxy config:", e);
|