node-http-proxy icon indicating copy to clipboard operation
node-http-proxy copied to clipboard

Cannot use 'in' operator to search in true

Open edwh opened this issue 6 years ago • 1 comments
trafficstars

I have an intermittent but very regular crash on v1.18 (was also on v1.17).

C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\common.js:221
    if (previousValue in config) {
                      ^

TypeError: Cannot use 'in' operator to search for 'modtools.org' in true
    at C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\common.js:221:23
    at String.replace (<anonymous>)
    at rewriteCookieProperty (C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\common.js:2
19:17)
    at C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\common.js:216:14
    at Array.map (<anonymous>)
    at Object.rewriteCookieProperty (C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\comm
on.js:215:19)
    at setHeader (C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\passes\web-outgoing.js:
93:29)
    at C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\passes\web-outgoing.js:124:7
    at Array.forEach (<anonymous>)
    at Array.writeHeaders (C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\passes\web-out
going.js:119:35)
    at ClientRequest.<anonymous> (C:\Users\edwar\PhpstormProjects\iznik-client\node_modules\http-proxy\lib\http-proxy\passes\
web-incoming.js:175:22)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:551:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:117:23)
    at TLSSocket.socketOnData (_http_client.js:440:20)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at TLSSocket.Readable.push (_stream_readable.js:208:10)
    at TLSWrap.onread (net.js:594:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev:mt: `node dev/servermt.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev:mt script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Is this my fault?

edwh avatar Oct 31 '19 10:10 edwh

A bit late answer, but if anyone still faces the same issue: cookieDomainRewrite property accepts an object with domains mapping, for example:

    cookieDomainRewrite: {
        "*": ""
    },

vetoshk1n avatar Oct 26 '21 11:10 vetoshk1n