koajs / csrf

CSRF tokens for koa
MIT License
264 stars 32 forks source link

Fix usage of includes in node 4.6.0 #29

Closed hung-phan closed 8 years ago

hung-phan commented 8 years ago

This PR is to use the method indexOf instead of includes for the reason that it doesn't work with the node 4.6.0 yet and causes error in server after the update.

[2016-09-29 23:12:10.592] [INFO] console -   xxx GET / 500 13ms -
  error TypeError: _this.opts.excludedMethods.includes is not a function
    at CSRF.middleware (/Users/hungphan/Desktop/workarea/koa-react-isomorphic/node_modules/koa-csrf/lib/index.js:39:36)
codecov-io commented 8 years ago

Current coverage is 78.37% (diff: 0.00%)

No coverage report found for master at 9118bb4.

Powered by Codecov. Last update 9118bb4...48394ca

hung-phan commented 8 years ago

@niftylettuce Updated

popomore commented 8 years ago

It should be merged to 2.x, 3.x is for koa@2 that support aa, []. includes is also supported 😄 .

hung-phan commented 8 years ago

What is the node version you are using to run @popomore?

popomore commented 8 years ago

async/await is supported by node@6 with harmony flag

hung-phan commented 8 years ago

I don't use node@6 with harmony flag. I use node@4 and use a transpiler on my modules. What is the best practice for koa.js then? 🤔

popomore commented 8 years ago

Sorry, I don't use transpiler on server side. LGTM for me now. Add node@4 to travis for testing?

hung-phan commented 8 years ago

Updated

hung-phan commented 8 years ago

@popomore, @niftylettuce.

niftylettuce commented 8 years ago

I've published 3.0.4 to NPM. @hung-phan any chance you could also update the History file?

hung-phan commented 8 years ago

ok @niftylettuce