-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to skip the mdleware on ajax requests on a specific route #57
Comments
like the idea ignoreRoute function. if array do what we do right now...if function call it with req and do next if true is returned. PR is very welcome....;) |
@jamuhl It's an old one, but is this on a roadmap? |
@isaachinman there is no "roadmap" for the express middleware...PRs get merged on demand. If this is needed for the next.js implementation i can look into this the next days (it's a small thing to add). |
@jamuhl I'm trying to match routes like this:
However, even with a whitelist in place, the express middleware is catching routes like:
And it's actually setting the |
Not sure if this would be better solved by something like |
hm...cookie should be set like: https://github.com/i18next/i18next-express-middleware/blob/master/src/languageLookups/cookie.js#L31 regarding the middleware getting triggered for statics - might be that handling changed from the road express 2 -> 4 --- so i will add that ignoreRoute function asap to handle such cases |
published in [email protected]
|
I know that you appreciate pull requests and I was tempted to just implement this and do pull request but then I thought it would be better to discuss it in order to make sure I don't violate the philosophy of the middle-ware
One way is introducing igroreAjaxRoutes in the middle-ware configuration.
Another way would be to provide an ignoreRoute function:
then use that function to check whether to skip and call next()
I guess the first is more clear but the second covers more cases.
The text was updated successfully, but these errors were encountered: