@sunshaobei/dsh-codex-auth 3.1.1 → 3.1.2
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/lib/proxy-fetch.mjs +4 -0
- package/package.json +1 -1
package/lib/proxy-fetch.mjs
CHANGED
|
@@ -63,6 +63,10 @@ function connectViaProxy(proxyUrl, host, port, timeoutMs) {
|
|
|
63
63
|
/** 在已建立的 TLS socket 上发送请求并收集完整响应。 */
|
|
64
64
|
function requestOverSocket(socket, url, { method = 'POST', headers = {}, body = '' } = {}) {
|
|
65
65
|
return new Promise((resolve, reject) => {
|
|
66
|
+
// Node fetch 允许 body 为 URLSearchParams;原始请求需要字符串
|
|
67
|
+
if (body && typeof body === 'object' && typeof body.toString === 'function' && !Buffer.isBuffer(body)) {
|
|
68
|
+
body = body.toString();
|
|
69
|
+
}
|
|
66
70
|
const timeout = setTimeout(() => {
|
|
67
71
|
socket.destroy();
|
|
68
72
|
reject(new Error('request timeout'));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sunshaobei/dsh-codex-auth",
|
|
3
3
|
"description": "Codex 订阅授权管理 for the dsh web surface: a dedicated settings page (authorization status, validity/expiry, one-click browser OAuth) plus an expired-credential modal when a GPT model is selected. Host half runs the full OpenAI OAuth flow (PKCE S256, localhost:1455 callback) and writes the llm-pi-ai/openai-codex grant record through ctx.credentials.",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|