refactor(OpenCode TLS): 共用 httpsAgent 建立邏輯
This commit is contained in:
+2
-3
@@ -1,6 +1,5 @@
|
||||
import axios from 'axios';
|
||||
import https from 'https';
|
||||
import { getLLMConfig, shouldSkipOpenCodeTLSVerify } from './config.js';
|
||||
import { getLLMConfig, getOpenCodeHttpsAgent } from './config.js';
|
||||
import { line, error } from './log.js';
|
||||
|
||||
function isOpenAIGpt55(provider, model) {
|
||||
@@ -50,7 +49,7 @@ function applyOpenCodeAuth(headers) {
|
||||
function opencodeAxiosOptions(headers) {
|
||||
return {
|
||||
headers,
|
||||
httpsAgent: shouldSkipOpenCodeTLSVerify() ? new https.Agent({ rejectUnauthorized: false }) : undefined,
|
||||
httpsAgent: getOpenCodeHttpsAgent(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user