xshell 1.0.99 → 1.0.101
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/net.js +1 -1
- package/package.json +6 -6
- package/server.js +1 -1
- package/utils.browser.d.ts +1 -1
- package/utils.d.ts +1 -1
package/net.js
CHANGED
|
@@ -198,7 +198,7 @@ export async function request(url, options = {}) {
|
|
|
198
198
|
headers,
|
|
199
199
|
body
|
|
200
200
|
};
|
|
201
|
-
if (!((200 <= status && status <= 299) || (redirect === 'manual' && 300 <= status && status < 400)))
|
|
201
|
+
if (!((200 <= status && status <= 299) || status === 304 || (redirect === 'manual' && 300 <= status && status < 400)))
|
|
202
202
|
throw Object.assign(new Error(t('状态码 {{status}}, 非 2xx: {{url}}', { status: response.status, url })), { name: 'StatusCodeError' });
|
|
203
203
|
}
|
|
204
204
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xshell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.101",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
"@babel/traverse": "^7.24.5",
|
|
59
59
|
"@koa/cors": "^5.0.0",
|
|
60
60
|
"@types/ws": "^8.5.10",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
62
|
-
"@typescript-eslint/parser": "^7.
|
|
63
|
-
"@typescript-eslint/utils": "^7.
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
|
62
|
+
"@typescript-eslint/parser": "^7.9.0",
|
|
63
|
+
"@typescript-eslint/utils": "^7.9.0",
|
|
64
64
|
"ali-oss": "^6.20.0",
|
|
65
65
|
"archiver": "^7.0.1",
|
|
66
66
|
"byte-size": "^8.1.1",
|
|
67
67
|
"chalk": "^5.3.0",
|
|
68
68
|
"chardet": "^2.0.0",
|
|
69
|
-
"cli-table3": "^0.6.
|
|
69
|
+
"cli-table3": "^0.6.5",
|
|
70
70
|
"cli-truncate": "^4.0.0",
|
|
71
71
|
"colors": "^1.4.0",
|
|
72
72
|
"commander": "^12.0.0",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"@types/koa-compress": "^4.0.6",
|
|
121
121
|
"@types/lodash": "^4.17.1",
|
|
122
122
|
"@types/mime-types": "^2.1.4",
|
|
123
|
-
"@types/node": "^20.12.
|
|
123
|
+
"@types/node": "^20.12.12",
|
|
124
124
|
"@types/react": "^18.3.2",
|
|
125
125
|
"@types/through2": "^2.0.41",
|
|
126
126
|
"@types/tough-cookie": "^4.0.5",
|
package/server.js
CHANGED
|
@@ -447,7 +447,7 @@ export class Server {
|
|
|
447
447
|
- queries?: 修改 (添加、覆盖、null 值时删除) 请求的 http queries, Record<string, string | null>
|
|
448
448
|
- redirect?: `manual` 重定向处理策略,默认按原样返回给客户端
|
|
449
449
|
- timeout?: `1000 * 5` 请求超时时间,可以传入 0 禁用超时 */
|
|
450
|
-
async request(ctx, path_url, { headers: headers_, redirect, queries, timeout } = {}) {
|
|
450
|
+
async request(ctx, path_url, { headers: headers_, redirect = 'manual', queries, timeout } = {}) {
|
|
451
451
|
const { request: { method, headers, query, body, ip } } = ctx;
|
|
452
452
|
let { response } = ctx;
|
|
453
453
|
const x_forwarded_for = headers['x-forwarded-for'] ? `${headers['x-forwarded-for']}, ${ip}` : ip;
|
package/utils.browser.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare function encode(str: string): Uint8Array;
|
|
|
63
63
|
在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
|
|
64
64
|
export declare function decode(buffer: Uint8Array): string;
|
|
65
65
|
/** 字符串字典序比较 */
|
|
66
|
-
export declare function strcmp(l: string, r: string):
|
|
66
|
+
export declare function strcmp(l: string, r: string): 1 | 0 | -1;
|
|
67
67
|
/** 比较 1.10.02 这种版本号 */
|
|
68
68
|
export declare function vercmp(l: string, r: string): number;
|
|
69
69
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|
package/utils.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare function filter_values<TObj extends Record<string, any>>(obj: TOb
|
|
|
39
39
|
/** 忽略对象中的 keys, 返回新对象 */
|
|
40
40
|
export declare function omit<TObj>(obj: TObj, omit_keys: string[]): TObj;
|
|
41
41
|
/** 字符串字典序比较 */
|
|
42
|
-
export declare function strcmp(l: string, r: string):
|
|
42
|
+
export declare function strcmp(l: string, r: string): 1 | 0 | -1;
|
|
43
43
|
/** 比较 1.10.02 这种版本号 */
|
|
44
44
|
export declare function vercmp(l: string, r: string): number;
|
|
45
45
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|