Skip to content

Commit

Permalink
Merge pull request #15 from doni404/hotfix/resources-cors-fix
Browse files Browse the repository at this point in the history
fix: update helmet setting cross origin for resources
  • Loading branch information
doni404 authored Jun 25, 2023
2 parents e53f21c + a5f5572 commit 6680374
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import newsRouter from './routes/news.js';
import resourcesRouter from './routes/resources.js';

// Addming helmet to enhance your API's security
app.use(helmet());
// app.use(helmet({
// crossOriginResourcePolicy: false,
// }));
// To handle resources cross origin
app.use(helmet.crossOriginResourcePolicy({ policy: "cross-origin" }));

// Using bodyParser to parse JSON bodies into JS object
app.use(bodyParser.json());
Expand Down

0 comments on commit 6680374

Please sign in to comment.