From 980ff9f99236d44c9e8221d4ba012c6f37f81c7d Mon Sep 17 00:00:00 2001 From: rtritto Date: Sun, 13 Oct 2024 14:20:58 +0200 Subject: [PATCH] Enforce proper case for numeric literals --- src/uws.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uws.js b/src/uws.js index e6a57707..f2ae84b6 100644 --- a/src/uws.js +++ b/src/uws.js @@ -42,7 +42,7 @@ module.exports.DeclarativeResponse = class DeclarativeResponse { this.instructions.push(opcode); const bytes = new TextEncoder().encode(text); const length = bytes.length; - this.instructions.push(length & 0xff, (length >> 8) & 0xff, ...bytes); + this.instructions.push(length & 0xFF, (length >> 8) & 0xFF, ...bytes); } writeHeader(key, value) { return this._appendInstruction(1, key, value), this; } @@ -55,7 +55,7 @@ module.exports.DeclarativeResponse = class DeclarativeResponse { end(value) { const bytes = new TextEncoder().encode(value); const length = bytes.length; - this.instructions.push(0, length & 0xff, (length >> 8) & 0xff, ...bytes); + this.instructions.push(0, length & 0xFF, (length >> 8) & 0xFF, ...bytes); return new Uint8Array(this.instructions).buffer; } }