remove urlencoded

we don't use this in our API
This commit is contained in:
Girish Ramakrishnan
2024-07-19 22:28:14 +02:00
parent 525e48ae59
commit 7f11699fac
5 changed files with 3 additions and 10 deletions
+2 -4
View File
@@ -36,13 +36,12 @@ async function initializeExpressSync() {
const wsServer = new ws.Server({ noServer: true }); // in noServer mode, we have to handle 'upgrade' and call handleUpgrade
const QUERY_LIMIT = '2mb', // max size for json and urlencoded queries (see also client_max_body_size in nginx)
const QUERY_LIMIT = '2mb', // max size for json queries (see also client_max_body_size in nginx)
FIELD_LIMIT = 2 * 1024 * 1024; // max fields that can appear in multipart
const REQUEST_TIMEOUT = 60000; // timeout for all requests (see also setTimeout on the httpServer)
const json = express.json({ strict: true, limit: QUERY_LIMIT }), // application/json
urlencoded = middleware.urlencoded({ extended: false, limit: QUERY_LIMIT }); // application/x-www-form-urlencoded
const json = express.json({ strict: true, limit: QUERY_LIMIT }); // application/json
app.set('json spaces', 2); // pretty json
@@ -56,7 +55,6 @@ async function initializeExpressSync() {
// the timeout middleware will respond with a 503. the request itself cannot be 'aborted' and will continue
// search for req.clearTimeout in route handlers to see places where this timeout is reset
.use(middleware.timeout(REQUEST_TIMEOUT, { respond: true }))
.use(urlencoded)
.use(middleware.cors({ origins: [ '*' ], allowCredentials: false }))
.use(router)
.use(notFoundHandler)