fix: honor Node all-address DNS lookup for HTTP webhooks
CSS quality / css-quality (push) Has been cancelled
CSS quality / css-quality (push) Has been cancelled
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import { createHash, createHmac } from 'node:crypto';
|
||||
import { HttpException } from '@nestjs/common';
|
||||
import type { LookupFunction } from 'node:net';
|
||||
|
||||
/** Keep the validated address pinned while honoring Node's all-address lookup contract. */
|
||||
export function pinnedWebhookLookup(address: string, family: number): LookupFunction {
|
||||
return (_hostname, options, callback) => {
|
||||
if (options.all) callback(null, [{ address, family }]);
|
||||
else callback(null, address, family);
|
||||
};
|
||||
}
|
||||
|
||||
/** v1 compatibility: an absent parsed body hashes as {}, never try alternate hashes. */
|
||||
export function openApiBodyHash(rawBody: Buffer | undefined, body: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user