From 09a1afb05e59ea7f10658b6896dedb2971b455d3 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 20 Oct 2025 22:19:32 +0800 Subject: [PATCH] feat: increase max HTTP header size (#20337) --- .github/workflows/docker-test-cont.yml | 1 + .github/workflows/issue-command.yml | 1 + package.json | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-test-cont.yml b/.github/workflows/docker-test-cont.yml index 9f87ad0c8..e18038c8a 100644 --- a/.github/workflows/docker-test-cont.yml +++ b/.github/workflows/docker-test-cont.yml @@ -67,6 +67,7 @@ jobs: docker run -d \ --name rsshub \ -e NODE_ENV=dev \ + -e NODE_OPTIONS='--max-http-header-size=32768' \ -e LOGGER_LEVEL=debug \ -e ALLOW_USER_HOTLINK_TEMPLATE=true \ -e ALLOW_USER_SUPPLY_UNSAFE_DOMAIN=true \ diff --git a/.github/workflows/issue-command.yml b/.github/workflows/issue-command.yml index e55352b6a..2b757ce41 100644 --- a/.github/workflows/issue-command.yml +++ b/.github/workflows/issue-command.yml @@ -104,6 +104,7 @@ jobs: ALLOW_USER_HOTLINK_TEMPLATE: true ALLOW_USER_SUPPLY_UNSAFE_DOMAIN: true NODE_ENV: dev + NODE_OPTIONS: '--max-http-header-size=32768' LOGGER_LEVEL: debug - name: Generate feedback diff --git a/package.json b/package.json index 539fac50c..2164b2e7c 100644 --- a/package.json +++ b/package.json @@ -24,15 +24,15 @@ "build": "tsx scripts/workflow/build-routes.ts && tsdown", "build:vercel": "tsx scripts/workflow/build-routes.ts && tsdown --config ./tsdown-vercel.config.ts && mv dist/server.js dist/index.js && tsx scripts/workflow/build-vercel-packagejson.ts", "build:docs": "tsx scripts/workflow/build-docs.ts", - "dev": "cross-env NODE_ENV=dev tsx watch --inspect --clear-screen=false lib/index.ts", - "dev:cache": "cross-env NODE_ENV=production tsx watch --clear-screen=false lib/index.ts", + "dev": "cross-env NODE_ENV=dev NODE_OPTIONS='--max-http-header-size=32768' tsx watch --inspect --clear-screen=false lib/index.ts", + "dev:cache": "cross-env NODE_ENV=production NODE_OPTIONS='--max-http-header-size=32768' tsx watch --clear-screen=false lib/index.ts", "format": "prettier \"**/*.{ts,tsx,js,json}\" --write --experimental-cli && eslint --cache --fix \"**/*.{ts,tsx,js,yml}\" --concurrency auto", "format:check": "prettier \"**/*.{ts,tsx,js,json}\" --check --experimental-cli && eslint --cache \"**/*.{ts,tsx,js,yml}\" --concurrency auto", "format:staged": "lint-staged", "lint": "eslint --cache . --concurrency auto", "prepare": "husky || true", "profiling": "cross-env NODE_ENV=production tsx --prof lib/index.ts", - "start": "cross-env NODE_ENV=production node dist/index.js", + "start": "cross-env NODE_ENV=production NODE_OPTIONS='--max-http-header-size=32768' node dist/index.js", "test": "npm run format:check && npm run vitest:coverage", "vitest": "cross-env NODE_ENV=test vitest", "vitest:coverage": "cross-env NODE_ENV=test vitest --coverage.enabled --reporter=junit",