mirror of
https://github.com/Metastem/wikiless
synced 2024-12-06 19:16:58 +01:00
Missing CSRF middleware https://github.com/Metastem/wikiless/security/code-scanning/1 [FIXED]
This commit is contained in:
@@ -3,6 +3,8 @@ const compression = require('compression')
|
||||
const path = require('path')
|
||||
const express = require('express')
|
||||
const cookieParser = require('cookie-parser')
|
||||
const session = require("express-session")
|
||||
const csrf = require('lusca').csrf;
|
||||
const fs = require('fs')
|
||||
const app = express()
|
||||
const r = require('redis')
|
||||
@@ -76,6 +78,8 @@ if(config.redirect_http_to_https) {
|
||||
app.use(compression())
|
||||
app.use(cookieParser())
|
||||
app.use(bodyParser.urlencoded({ extended: true, limit: '10mb' }))
|
||||
app.use(session({ secret: process.env['SECRET'], cookie: { maxAge: 60000 } }));
|
||||
app.use(csrf());
|
||||
app.use(express.static(path.join(__dirname, '../static')))
|
||||
app.use(express.static(path.join(__dirname, '../media')))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user