Browse Source

feat: server.enable('trust proxy');

pull/2732/head
jinxm 2 years ago
parent
commit
7a1bba4112
  1. 1
      packages/nocodb/docker/index.js
  2. 2
      packages/nocodb/src/__tests__/graphql.test.ts
  3. 1
      packages/nocodb/src/__tests__/rest.test.ts
  4. 1
      packages/nocodb/src/__tests__/restv2.test.ts
  5. 1
      packages/nocodb/src/lib/v1-legacy/nc.try.ts
  6. 2
      packages/nocodb/src/run/docker.ts
  7. 2
      packages/nocodb/src/run/dockerRunMysql.ts
  8. 2
      packages/nocodb/src/run/dockerRunPG.ts
  9. 2
      packages/nocodb/src/run/dockerRunPG_CyQuick.ts
  10. 2
      packages/nocodb/src/run/try.ts

1
packages/nocodb/docker/index.js

@ -2,6 +2,7 @@ const Noco = require("../build/main/lib/Noco").default;
const express = require('express');
const cors = require('cors');
const server = express();
server.enable('trust proxy');
server.use(cors());

2
packages/nocodb/src/__tests__/graphql.test.ts

@ -63,6 +63,8 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => {
this.timeout(10000);
(async () => {
const server = express();
server.enable('trust proxy');
server.use(await Noco.init({}));
app = server;

1
packages/nocodb/src/__tests__/rest.test.ts

@ -81,6 +81,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => {
(async () => {
const server = express();
server.enable('trust proxy');
server.use(await Noco.init());
app = server;

1
packages/nocodb/src/__tests__/restv2.test.ts

@ -95,6 +95,7 @@ describe('Noco v2 Tests', () => {
} catch {}
const server = express();
server.enable('trust proxy');
server.use(await Noco.init());
app = server;

1
packages/nocodb/src/lib/v1-legacy/nc.try.ts

@ -8,6 +8,7 @@ import Noco from '../Noco';
export default async function (dbUrl): Promise<void> {
const server = express();
server.use(cors());
server.enable('trust proxy');
server.set('view engine', 'ejs');

2
packages/nocodb/src/run/docker.ts

@ -5,6 +5,8 @@ import Noco from '../lib/Noco';
process.env.NC_VERSION = '0009044';
const server = express();
server.enable('trust proxy');
server.use(
cors({
exposedHeaders: 'xc-db-response',

2
packages/nocodb/src/run/dockerRunMysql.ts

@ -5,6 +5,8 @@ import Noco from '../lib/Noco';
process.env.NC_VERSION = '0009044';
const server = express();
server.enable('trust proxy');
server.use(
cors({
exposedHeaders: 'xc-db-response',

2
packages/nocodb/src/run/dockerRunPG.ts

@ -5,6 +5,8 @@ import Noco from '../lib/Noco';
process.env.NC_VERSION = '0009044';
const server = express();
server.enable('trust proxy');
server.use(
cors({
exposedHeaders: 'xc-db-response',

2
packages/nocodb/src/run/dockerRunPG_CyQuick.ts

@ -5,6 +5,8 @@ import Noco from '../lib/Noco';
process.env.NC_VERSION = '0009044';
const server = express();
server.enable('trust proxy');
server.use(
cors({
exposedHeaders: 'xc-db-response',

2
packages/nocodb/src/run/try.ts

@ -11,6 +11,8 @@ process.env.NC_DB = url;
(async () => {
const server = express();
server.enable('trust proxy');
server.use(cors());
server.set('view engine', 'ejs');
const app = new Noco();

Loading…
Cancel
Save