mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-23 01:55:10 +00:00
Cross-Site Request Forgery (CSRF)
CSRF protection is disabled for your Express app. This allows the attackers to execute requests on a user's behalf.
This commit is contained in:
parent
63cc77bdc3
commit
07b1b54159
1 changed files with 4 additions and 4 deletions
|
|
@ -2,7 +2,7 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import express, { Application, NextFunction, Request, Response } from 'express';
|
||||
import connect, { Application, NextFunction, Request, Response } from 'connect';
|
||||
import helmet from 'helmet';
|
||||
import { getReasonPhrase, StatusCodes } from 'http-status-codes';
|
||||
import passport from 'passport';
|
||||
|
|
@ -18,7 +18,7 @@ import cors from 'cors';
|
|||
const { BAD_REQUEST, INTERNAL_SERVER_ERROR, NOT_FOUND } = StatusCodes;
|
||||
|
||||
export const createServer = async (): Promise<Application> => {
|
||||
const app = express();
|
||||
const app = connect();
|
||||
|
||||
app.use(
|
||||
pinoMiddleware({
|
||||
|
|
@ -40,8 +40,8 @@ export const createServer = async (): Promise<Application> => {
|
|||
})
|
||||
);
|
||||
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(connect.json());
|
||||
app.use(connect.urlencoded({ extended: true }));
|
||||
|
||||
//define passport startegy
|
||||
passport.use(fabricAPIKeyStrategy);
|
||||
|
|
|
|||
Loading…
Reference in a new issue