Skip to content
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

[Snyk] Upgrade validator from 13.11.0 to 13.12.0 #8

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update app.js
disabling xss helmet and ratelimit
  • Loading branch information
Safar123 authored May 27, 2024
commit f80502f75e248b2e97372f670600998e2bef5340
32 changes: 16 additions & 16 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ const express = require ('express');
const morgan = require('morgan');
const GlobalError = require('./utils/globalError');
const errorHandler = require('./Controller/errorController');
const rateLimit = require('express-rate-limit');
const helmet = require('helmet');
const mongoSanitize= require('express-mongo-sanitize');
const xss = require('xss-clean');
const hpp = require('hpp');
const csurf = require('csurf');
//const rateLimit = require('express-rate-limit');
//const helmet = require('helmet');
//const mongoSanitize= require('express-mongo-sanitize');
//const xss = require('xss-clean');
//const hpp = require('hpp');
//const csurf = require('csurf');

const app = express();
app.use(helmet());
//app.use(helmet());

const limiter = rateLimit({
max:100,
windowMs:60*60*1000,
message:'Too many request from this IP. Please try an hour later'
})
//const limiter = rateLimit({
// max:100,
// windowMs:60*60*1000,
// message:'Too many request from this IP. Please try an hour later'
//})

app.use('/api', limiter);
//app.use('/api', limiter);
app.use(express.json());

app.use(mongoSanitize());
app.use(xss());
app.use(hpp());
// app.use(mongoSanitize());
// app.use(xss());
// app.use(hpp());

const userRoute = require('./Routes/userRoutes');
const recipeRoute = require('./Routes/recipeRoute');
Expand Down