1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-05 05:25:29 +02:00

feat: Version 2

Closes #627, closes #1047
This commit is contained in:
Maksim Eltyshev 2025-05-10 02:09:06 +02:00
parent ad7fb51cfa
commit 2ee1166747
1557 changed files with 76832 additions and 47042 deletions

View file

@ -1,5 +1,5 @@
const { expect } = require('chai');
const { getRemoteAddress } = require('../../utils/remoteAddress');
const { getRemoteAddress } = require('../../utils/remote-address');
/**
* Fake HTTP request object
@ -26,10 +26,10 @@ const mockRequest = (ip, ips) => {
* @param {boolean} trustProxy Whether the TRUST_PROXY environment variable was enabled.
*/
const mockProxyFlag = (trustProxy) => {
process.env.TRUST_PROXY = !!trustProxy;
process.env.TRUST_PROXY = trustProxy.toString();
};
describe('remoteAddress', () => {
describe('remote-address', () => {
describe('#getRemoteAddress(Request)', () => {
it('should get IPv4 remote address while not behind proxy and TRUST_PROXY=false', async () => {
const expectedAddress = '172.2.109.132';