mirror of
https://github.com/plankanban/planka.git
synced 2025-12-24 17:25:00 +03:00
@@ -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';
|
||||
Reference in New Issue
Block a user