|
|
@ -1,5 +1,4 @@
|
|
|
|
import { getClientIp } from '@supercharge/request-ip';
|
|
|
|
import { getClientIp } from '@supercharge/request-ip';
|
|
|
|
import bodyParser from 'body-parser';
|
|
|
|
|
|
|
|
import { TypeormStore } from 'connect-typeorm/out';
|
|
|
|
import { TypeormStore } from 'connect-typeorm/out';
|
|
|
|
import cookieParser from 'cookie-parser';
|
|
|
|
import cookieParser from 'cookie-parser';
|
|
|
|
import csurf from 'csurf';
|
|
|
|
import csurf from 'csurf';
|
|
|
@ -71,9 +70,9 @@ app
|
|
|
|
server.enable('trust proxy');
|
|
|
|
server.enable('trust proxy');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
server.use(cookieParser());
|
|
|
|
server.use(cookieParser());
|
|
|
|
server.use(bodyParser.json());
|
|
|
|
server.use(express.json());
|
|
|
|
server.use(bodyParser.urlencoded({ extended: true }));
|
|
|
|
server.use(express.urlencoded({ extended: true }));
|
|
|
|
server.use((req, res, next) => {
|
|
|
|
server.use((req, _res, next) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const descriptor = Object.getOwnPropertyDescriptor(req, 'ip');
|
|
|
|
const descriptor = Object.getOwnPropertyDescriptor(req, 'ip');
|
|
|
|
if (descriptor?.writable === true) {
|
|
|
|
if (descriptor?.writable === true) {
|
|
|
|