From b8f886adf0bca2bc650743c12276cd820771dc24 Mon Sep 17 00:00:00 2001 From: Jayson Jacobs Date: Tue, 24 Sep 2024 19:24:13 -0600 Subject: [PATCH] increase default payload limit & log it --- package.json | 2 +- src/index.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e5e600b..be58a23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "llm-proxy", - "version": "1.3.0", + "version": "1.3.1", "description": "Manages Nginx for reverse proxy to multiple LLMs, with TLS & Bearer Auth tokens", "main": "dist/index.js", "scripts": { diff --git a/src/index.ts b/src/index.ts index 2c81eca..c9ed7d0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ import { NginxController } from './controllers/nginx' import { LLMController } from './controllers/llm' import { tokenMiddleware } from './utils/auth' import { AuthController } from './controllers/auth' +import { log } from './utils/general' dotenv.config() @@ -14,11 +15,12 @@ const targetUrls = (process.env.TARGET_URLS || 'http://example.com').split(','). app.use(express.json()) -const payloadLimit = process.env.PAYLOAD_LIMIT || '250kb' +const payloadLimit = process.env.PAYLOAD_LIMIT || '1mb' //support application/json type post data (default limit is 100kb) app.use(bodyParser.json({ limit: payloadLimit })) //support application/x-www-form-urlencoded post data (default limit is 100kb) app.use(bodyParser.urlencoded({ limit: payloadLimit, extended: false })) +log('info', `Payload limit is: ${payloadLimit}`) // Express routes app.get('/', (req, res) => {