make sanitization failures permanent
Some checks failed
Publish Docker image / Build (push) Waiting to run
Test (production install and build) / production (22.11.0) (push) Waiting to run
Lint / pnpm_install (push) Successful in 1m8s
Test (backend) / unit (22.11.0) (push) Failing after 6m45s
Lint / pnpm_install (pull_request) Successful in 1m7s
Publish Docker image / Build (pull_request) Successful in 4m10s
Test (backend) / e2e (22.11.0) (push) Failing after 10m23s
Test (production install and build) / production (22.11.0) (pull_request) Successful in 56s
Test (backend) / unit (22.11.0) (pull_request) Failing after 6m57s
Test (backend) / e2e (22.11.0) (pull_request) Failing after 10m10s
Lint / lint (frontend) (push) Successful in 2m6s
Lint / lint (backend) (push) Successful in 2m33s
Lint / lint (frontend-embed) (push) Successful in 2m6s
Lint / lint (misskey-bubble-game) (push) Successful in 2m6s
Lint / lint (frontend-shared) (push) Successful in 2m17s
Lint / lint (misskey-js) (push) Successful in 2m15s
Lint / typecheck (backend) (push) Failing after 1m25s
Lint / lint (sw) (push) Successful in 2m15s
Lint / lint (misskey-reversi) (push) Successful in 2m18s
Lint / typecheck (misskey-js) (push) Successful in 1m21s
Lint / typecheck (sw) (push) Successful in 1m20s
Lint / lint (backend) (pull_request) Successful in 2m11s
Lint / lint (frontend) (pull_request) Successful in 2m10s
Lint / lint (frontend-embed) (pull_request) Successful in 1m59s
Lint / lint (frontend-shared) (pull_request) Successful in 2m1s
Lint / lint (misskey-bubble-game) (pull_request) Successful in 2m0s
Lint / lint (misskey-js) (pull_request) Successful in 1m59s
Lint / lint (misskey-reversi) (pull_request) Successful in 1m59s
Lint / typecheck (backend) (pull_request) Failing after 1m28s
Lint / lint (sw) (pull_request) Successful in 2m1s
Lint / typecheck (misskey-js) (pull_request) Successful in 1m34s
Lint / typecheck (sw) (pull_request) Successful in 1m22s
Some checks failed
Publish Docker image / Build (push) Waiting to run
Test (production install and build) / production (22.11.0) (push) Waiting to run
Lint / pnpm_install (push) Successful in 1m8s
Test (backend) / unit (22.11.0) (push) Failing after 6m45s
Lint / pnpm_install (pull_request) Successful in 1m7s
Publish Docker image / Build (pull_request) Successful in 4m10s
Test (backend) / e2e (22.11.0) (push) Failing after 10m23s
Test (production install and build) / production (22.11.0) (pull_request) Successful in 56s
Test (backend) / unit (22.11.0) (pull_request) Failing after 6m57s
Test (backend) / e2e (22.11.0) (pull_request) Failing after 10m10s
Lint / lint (frontend) (push) Successful in 2m6s
Lint / lint (backend) (push) Successful in 2m33s
Lint / lint (frontend-embed) (push) Successful in 2m6s
Lint / lint (misskey-bubble-game) (push) Successful in 2m6s
Lint / lint (frontend-shared) (push) Successful in 2m17s
Lint / lint (misskey-js) (push) Successful in 2m15s
Lint / typecheck (backend) (push) Failing after 1m25s
Lint / lint (sw) (push) Successful in 2m15s
Lint / lint (misskey-reversi) (push) Successful in 2m18s
Lint / typecheck (misskey-js) (push) Successful in 1m21s
Lint / typecheck (sw) (push) Successful in 1m20s
Lint / lint (backend) (pull_request) Successful in 2m11s
Lint / lint (frontend) (pull_request) Successful in 2m10s
Lint / lint (frontend-embed) (pull_request) Successful in 1m59s
Lint / lint (frontend-shared) (pull_request) Successful in 2m1s
Lint / lint (misskey-bubble-game) (pull_request) Successful in 2m0s
Lint / lint (misskey-js) (pull_request) Successful in 1m59s
Lint / lint (misskey-reversi) (pull_request) Successful in 1m59s
Lint / typecheck (backend) (pull_request) Failing after 1m28s
Lint / lint (sw) (pull_request) Successful in 2m1s
Lint / typecheck (misskey-js) (pull_request) Successful in 1m34s
Lint / typecheck (sw) (pull_request) Successful in 1m22s
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
parent
5b6e8cc110
commit
e01e82aa65
2 changed files with 7 additions and 10 deletions
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
import { target } from "happy-dom/lib/PropertySymbol.js";
|
import { target } from "happy-dom/lib/PropertySymbol.js";
|
||||||
import { toASCII } from "node:punycode";
|
import { toASCII } from "node:punycode";
|
||||||
|
import * as bull from "bullmq";
|
||||||
|
|
||||||
export type Obj = { [x: string]: any };
|
export type Obj = { [x: string]: any };
|
||||||
export type ApObject = IObject | string | (IObject | string)[];
|
export type ApObject = IObject | string | (IObject | string)[];
|
||||||
|
@ -81,11 +82,11 @@ export function yumeNormalizeURL(url: string): string {
|
||||||
u.hash = '';
|
u.hash = '';
|
||||||
u.host = toASCII(u.host);
|
u.host = toASCII(u.host);
|
||||||
if (u.protocol && u.protocol !== 'https:') {
|
if (u.protocol && u.protocol !== 'https:') {
|
||||||
throw new Error('protocol is not https');
|
throw new bull.UnrecoverableError('protocol is not https');
|
||||||
}
|
}
|
||||||
u.protocol = 'https:';
|
u.protocol = 'https:';
|
||||||
if (u.port && u.port !== '443') {
|
if (u.port && u.port !== '443') {
|
||||||
throw new Error('port is not 443');
|
throw new bull.UnrecoverableError('port is not 443');
|
||||||
}
|
}
|
||||||
return u.toString();
|
return u.toString();
|
||||||
}
|
}
|
||||||
|
@ -93,7 +94,7 @@ export function yumeNormalizeURL(url: string): string {
|
||||||
export function yumeNormalizeRecursive<O extends IUnsanitizedObject | string | (IUnsanitizedObject | string)[]>(object: O, depth = 0):
|
export function yumeNormalizeRecursive<O extends IUnsanitizedObject | string | (IUnsanitizedObject | string)[]>(object: O, depth = 0):
|
||||||
IObject | string | (IObject | string)[] {
|
IObject | string | (IObject | string)[] {
|
||||||
if (depth > 16) {
|
if (depth > 16) {
|
||||||
throw new Error('recursion limit exceeded');
|
throw new bull.UnrecoverableError('recursion limit exceeded');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof object === 'string') {
|
if (typeof object === 'string') {
|
||||||
|
@ -101,7 +102,7 @@ export function yumeNormalizeRecursive<O extends IUnsanitizedObject | string | (
|
||||||
}
|
}
|
||||||
if (Array.isArray(object)) {
|
if (Array.isArray(object)) {
|
||||||
if (object.length > 64) {
|
if (object.length > 64) {
|
||||||
throw new Error('array length limit exceeded');
|
throw new bull.UnrecoverableError('array length limit exceeded');
|
||||||
}
|
}
|
||||||
return object.flatMap(yumeNormalizeRecursive);
|
return object.flatMap(yumeNormalizeRecursive);
|
||||||
}
|
}
|
||||||
|
@ -121,10 +122,6 @@ export function yumeNormalizeObject(object: IUnsanitizedObject): IObject {
|
||||||
object.url = yumeNormalizeRecursive(object.url);
|
object.url = yumeNormalizeRecursive(object.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (object.attachment) {
|
|
||||||
object.attachment = object.attachment.map(yumeNormalizeRecursive);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (object.inReplyTo) {
|
if (object.inReplyTo) {
|
||||||
object.inReplyTo = yumeNormalizeRecursive(object.inReplyTo);
|
object.inReplyTo = yumeNormalizeRecursive(object.inReplyTo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ const mIncomingApReject = metricCounter({
|
||||||
const mincomingApProcessingError = metricCounter({
|
const mincomingApProcessingError = metricCounter({
|
||||||
name: 'misskey_incoming_ap_processing_error',
|
name: 'misskey_incoming_ap_processing_error',
|
||||||
help: 'Incoming AP processing error',
|
help: 'Incoming AP processing error',
|
||||||
labelNames: ['incoming_host', 'incoming_type', 'reason'],
|
labelNames: ['incoming_host', 'incoming_type'],
|
||||||
});
|
});
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -307,7 +307,7 @@ export class InboxProcessorService implements OnApplicationShutdown {
|
||||||
}
|
}
|
||||||
const end = +new Date();
|
const end = +new Date();
|
||||||
observeHistogram(mIncomingApProcessingTime, { success: 'false' }, (end - begin) / 1000);
|
observeHistogram(mIncomingApProcessingTime, { success: 'false' }, (end - begin) / 1000);
|
||||||
incCounter(mincomingApProcessingError, { reason: 'unknown' });
|
incCounter(mincomingApProcessingError, {});
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
observeHistogram(mIncomingApProcessingTime, { success: 'true' }, (+new Date() - begin) / 1000);
|
observeHistogram(mIncomingApProcessingTime, { success: 'true' }, (+new Date() - begin) / 1000);
|
||||||
|
|
Loading…
Reference in a new issue