From 3dc0dfad4d036bc92a3d217aebc7578295949b81 Mon Sep 17 00:00:00 2001 From: Duddino Date: Sat, 7 Dec 2024 17:34:46 +0100 Subject: [PATCH] Accept X-Content-Length as fallback too (#485) * Accept X-Content-Length as fallback too * Remove debugger --- scripts/reader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/reader.js b/scripts/reader.js index 7fc70595f..02ec746f8 100644 --- a/scripts/reader.js +++ b/scripts/reader.js @@ -27,7 +27,9 @@ export class Reader { */ constructor(req) { this.#availableBytes = new Uint8Array( - req.headers?.get('Content-Length') || 1024 + req.headers?.get('Content-Length') || + req.headers?.get('X-Content-Length') || + 1024 ); const stream = req.body.getReader(); (async () => {