mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #33361 from overleaf/copilot/remove-direct-use-of-body-parser
Remove direct use of body-parser in favour of express built-ins GitOrigin-RevId: 656c5f216daf68e86d53ae07d272e080bd5ab27f
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import metrics from '@overleaf/metrics'
|
||||
import logger from '@overleaf/logger'
|
||||
import settings from '@overleaf/settings'
|
||||
import express from 'express'
|
||||
import WebsocketController from './WebsocketController.js'
|
||||
import HttpController from './HttpController.js'
|
||||
import HttpApiController from './HttpApiController.js'
|
||||
import WebsocketAddressManager from './WebsocketAddressManager.js'
|
||||
import bodyParser from 'body-parser'
|
||||
import base64id from 'base64id'
|
||||
import Errors from './Errors.js'
|
||||
import { z, zz } from '@overleaf/validation-tools'
|
||||
@@ -157,7 +157,7 @@ export default Router = {
|
||||
|
||||
app.post(
|
||||
'/project/:project_id/message/:message',
|
||||
bodyParser.json({ limit: '5mb' }),
|
||||
express.json({ limit: '5mb' }),
|
||||
HttpApiController.sendMessage
|
||||
)
|
||||
app.get(
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
"@overleaf/validation-tools": "workspace:*",
|
||||
"async": "^3.2.5",
|
||||
"base64id": "0.1.0",
|
||||
"body-parser": "1.20.4",
|
||||
"bunyan": "^1.8.15",
|
||||
"connect-redis": "^6.1.3",
|
||||
"cookie-parser": "^1.4.6",
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
import sinon from 'sinon'
|
||||
import express from 'express'
|
||||
import bodyParser from 'body-parser'
|
||||
|
||||
let MockWebServer
|
||||
|
||||
@@ -90,7 +89,7 @@ export default MockWebServer = {
|
||||
return callback()
|
||||
}
|
||||
const app = express()
|
||||
app.use(bodyParser.json())
|
||||
app.use(express.json())
|
||||
app.post('/project/:project_id/join', MockWebServer.joinProjectRequest)
|
||||
return app
|
||||
.listen(3000, error => {
|
||||
|
||||
Reference in New Issue
Block a user