Skip to content

Trying to modify passed in values #10

@elmigranto

Description

@elmigranto

I have my configuration options in deeply frozen object, so I do not accidentaly modify them and use new ones somewhere else. When setting trust proxy from that config object, proxy-addr tries to modify it.

Versions I have are express@4.15.3 and proxy-addr@1.1.4. The fix might be to .slice() it first:

   var trust = trustArg.slice();

Relevant stacktrace frames:

<project>/node_modules/proxy-addr/index.js:106
    trust.splice.apply(trust, [i, 1].concat(val));
                 ^

TypeError: Cannot add/remove sealed array elements
    at Array.splice (<anonymous>)
    at Function.compile (<project>/node_modules/proxy-addr/index.js:106:18)
    at exports.compileTrust (<project>/node_modules/express/lib/utils.js:250:20)
    at Function.set (<project>/node_modules/express/lib/application.js:372:34)
    <  omitted  >

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions