Skip to content

Commit

Permalink
Merge pull request #13 from j4ys0n/request-limit
Browse files Browse the repository at this point in the history
increase default payload limit & log it
  • Loading branch information
j4ys0n authored Sep 25, 2024
2 parents 79cc368 + b8f886a commit 1820234
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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) => {
Expand Down

0 comments on commit 1820234

Please sign in to comment.