veryfront 0.1.319 → 0.1.320
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/esm/deno.js +1 -1
- package/esm/src/proxy/log-noise.d.ts +1 -1
- package/esm/src/proxy/log-noise.d.ts.map +1 -1
- package/esm/src/proxy/log-noise.js +2 -0
- package/esm/src/proxy/main.js +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/deno.js +1 -1
- package/src/src/proxy/log-noise.ts +2 -1
- package/src/src/proxy/main.ts +1 -1
- package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function isLikelyScannerProbePath(pathname: string): boolean;
|
|
2
|
-
export type ProxyFailureLogLevel = "warn" | "error";
|
|
2
|
+
export type ProxyFailureLogLevel = "info" | "warn" | "error";
|
|
3
3
|
export declare function getProxyFailureLogLevel(status: number, method: string, pathname: string): ProxyFailureLogLevel;
|
|
4
4
|
//# sourceMappingURL=log-noise.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-noise.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/log-noise.ts"],"names":[],"mappings":"AAcA,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQlE;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"log-noise.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/log-noise.ts"],"names":[],"mappings":"AAcA,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQlE;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7D,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,oBAAoB,CAWtB"}
|
package/esm/src/proxy/main.js
CHANGED
|
@@ -246,7 +246,7 @@ function forwardToServer(req) {
|
|
|
246
246
|
}, async () => {
|
|
247
247
|
if (ctx.error) {
|
|
248
248
|
const ms = Math.round(performance.now() - startTime);
|
|
249
|
-
const logLevel = ctx.error.status
|
|
249
|
+
const logLevel = getProxyFailureLogLevel(ctx.error.status, req.method, url.pathname);
|
|
250
250
|
proxyLogger[logLevel](`${ctx.error.status} ${req.method} ${url.pathname}`, { ms });
|
|
251
251
|
endSpan(spanInfo?.span, ctx.error.status);
|
|
252
252
|
return createProxyErrorResponse(ctx.error);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.320";
|
|
2
2
|
//# sourceMappingURL=version-constant.d.ts.map
|
package/package.json
CHANGED
package/src/deno.js
CHANGED
|
@@ -22,7 +22,7 @@ export function isLikelyScannerProbePath(pathname: string): boolean {
|
|
|
22
22
|
.some((segment) => SCANNER_PROBE_SEGMENTS.has(segment));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export type ProxyFailureLogLevel = "warn" | "error";
|
|
25
|
+
export type ProxyFailureLogLevel = "info" | "warn" | "error";
|
|
26
26
|
|
|
27
27
|
export function getProxyFailureLogLevel(
|
|
28
28
|
status: number,
|
|
@@ -37,5 +37,6 @@ export function getProxyFailureLogLevel(
|
|
|
37
37
|
return "warn";
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
if (status < 400) return "info";
|
|
40
41
|
return status < 500 ? "warn" : "error";
|
|
41
42
|
}
|
package/src/src/proxy/main.ts
CHANGED
|
@@ -302,7 +302,7 @@ function forwardToServer(req: Request): Promise<Response> {
|
|
|
302
302
|
async () => {
|
|
303
303
|
if (ctx.error) {
|
|
304
304
|
const ms = Math.round(performance.now() - startTime);
|
|
305
|
-
const logLevel = ctx.error.status
|
|
305
|
+
const logLevel = getProxyFailureLogLevel(ctx.error.status, req.method, url.pathname);
|
|
306
306
|
proxyLogger[logLevel](`${ctx.error.status} ${req.method} ${url.pathname}`, { ms });
|
|
307
307
|
endSpan(spanInfo?.span, ctx.error.status);
|
|
308
308
|
return createProxyErrorResponse(ctx.error);
|