Aconex / drakov

Mock Server that implements the API Blueprint specification
MIT License
481 stars 115 forks source link

Error on ignoreHeader command line argument #180

Closed kamihouse closed 6 years ago

kamihouse commented 6 years ago

When using the commands --ignoreHeader Cookie or --ignoreHeader Authorization I get the following error when accessing a resource:

"drakov": "^1.0.4",

TypeError: ignoreHeaders.map is not a function
    at Object.exports.matchesHeader (/node_modules/drakov/lib/content.js:114:53)
    at /node_modules/drakov/lib/handler-filter.js:6:24
    at Array.filter (<anonymous>)
    at Object.exports.filterHandlers (/node_modules/drakov/lib/handler-filter.js:36:37)
    at /node_modules/drakov/lib/middleware/route-handlers.js:26:38
    at Array.forEach (<anonymous>)
    at middleware (/node_modules/drakov/lib/middleware/route-handlers.js:15:35)
    at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/node_modules/express/lib/router/index.js:317:13)
    at /node_modules/express/lib/router/index.js:284:7

captura de tela 2018-06-04 as 10 56 46

subinvarghesein commented 6 years ago

@aj-jaswanth could this be related to your commit? https://github.com/Aconex/drakov/commit/5e6c9787c4dac5608a86295364c89a3479ff8cc1

aj-jaswanth commented 6 years ago

Hi @kamihouse, are you seeing this issue when using both the --ignoreHeader Cookie --ignoreHeader Authorization together?

I saw this issue happening when only one --ignoreHeader is specified. This issue was fixed as part of https://github.com/Aconex/drakov/commit/5e6c9787c4dac5608a86295364c89a3479ff8cc1 which is not yet released.

If you are facing the issue while specifying only one --ignoreHeader option, a quick fix would be to repeat the same option again.

kamihouse commented 6 years ago

Hi @aj-jaswanth Yes, the problem happens when I specify only one --ignoreHeader.

Thanks for your help!