Aconex / drakov

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

CLI option `--ignoreHeader` causes error #177

Closed b1f6c1c4 closed 6 years ago

b1f6c1c4 commented 6 years ago
[System.Environment]::OSVersion.Version
# Major  Minor  Build  Revision
# -----  -----  -----  --------
# 10     0      16299  0

node --version
# v9.3.0
npm --version
# 5.5.1
npm --global install drakov@1.0.4
drakov -f ../master/docs/api.apib -p 3001 --autoOptions --ignoreHeader Authorization

Then curl it will get:

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

But drakov -f ../master/docs/api.apib -p 3001 --autoOptions --ignoreHeader Authorization --ignoreHeader Cookie will be fine.

aj-jaswanth commented 6 years ago

Hi @b1f6c1c4 This is fixed as part of https://github.com/Aconex/drakov/pull/166