Files
stats/patches/buffer-equal-constant-time.patch
zias be64494aa9
Some checks failed
Build and Push API / build-api (push) Failing after 39m34s
Build and Push Dashboard / build-dashboard (push) Has been cancelled
Build and Push Worker / build-worker (push) Has been cancelled
feat: add Gitea CI workflows, production compose, and update all deps
- Add .gitea/workflows for building and pushing api, dashboard, and worker images to git.zias.be registry
- Add docker-compose.prod.yml using pre-built registry images (no build-from-source on server)
- Update docker-compose.yml infra images to latest (postgres 18.3, redis 8.6.2, clickhouse 26.3.2.3)
- Update self-hosting/docker-compose.template.yml image versions to match
- Bump Node.js to 22.22.2 in all three Dockerfiles
- Update pnpm to 10.33.0 and upgrade all safe npm dependencies
- Add buffer-equal-constant-time patch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 09:18:55 +02:00

43 lines
1.3 KiB
Diff

diff --git a/.npmignore b/.npmignore
deleted file mode 100644
index 34e4f5c298de294fa5c1c1769b6489eb047bde9a..0000000000000000000000000000000000000000
diff --git a/index.js b/index.js
index 5462c1f830bdbe79bf2b1fcfd811cd9799b4dd11..689421d49e83d168981a0c7d1fef59a0b0e56963 100644
--- a/index.js
+++ b/index.js
@@ -3,6 +3,9 @@
var Buffer = require('buffer').Buffer; // browserify
var SlowBuffer = require('buffer').SlowBuffer;
+// Handle Node.js v25+ where SlowBuffer was removed
+var hasSlowBuffer = !!SlowBuffer;
+
module.exports = bufferEq;
function bufferEq(a, b) {
@@ -28,14 +31,18 @@ function bufferEq(a, b) {
}
bufferEq.install = function() {
- Buffer.prototype.equal = SlowBuffer.prototype.equal = function equal(that) {
- return bufferEq(this, that);
- };
+ Buffer.prototype.equal = function equal(that) {
+ return bufferEq(this, that);
+ };
+ if (hasSlowBuffer) {
+ SlowBuffer.prototype.equal = Buffer.prototype.equal;
+ }
};
var origBufEqual = Buffer.prototype.equal;
-var origSlowBufEqual = SlowBuffer.prototype.equal;
bufferEq.restore = function() {
- Buffer.prototype.equal = origBufEqual;
- SlowBuffer.prototype.equal = origSlowBufEqual;
+ Buffer.prototype.equal = origBufEqual;
+ if (hasSlowBuffer && SlowBuffer.prototype) {
+ delete SlowBuffer.prototype.equal;
+ }
};