Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Allow custom function of ignore checking #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SOF3
Copy link

@SOF3 SOF3 commented Dec 30, 2018

No description provided.

@SOF3 SOF3 closed this Dec 30, 2018
@SOF3
Copy link
Author

SOF3 commented Dec 30, 2018

I want to ignore send a token if a GET parameter is present and redirect user to another site (GitHub OAuth login), so even other methods like path filtering wouldn't work.

Copy link
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for your pull request. Sorry I was away for a bit and missed your PR coming in.

I made one comment, and added labels for the following things to add to this PR as well:

  1. Tests for the new feature
  2. Documentation for the new feature

@@ -58,12 +58,12 @@ function csurf (options) {
? ['GET', 'HEAD', 'OPTIONS']
: opts.ignoreMethods

if (!Array.isArray(ignoreMethods)) {
if (!Array.isArray(ignoreMethods) && typeof ignoreMethods !== "function") {
throw new TypeError('option ignoreMethods must be an array')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update this error to reflect new possible valid type

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants