Skip to content

Commit

Permalink
Adding X-Content-Type-Options: nosniff header
Browse files Browse the repository at this point in the history
Protects some browsers against MIME sniffing attacks. (Does not help Firefox
due to: https://bugzilla.mozilla.org/show_bug.cgi?id=471020)
  • Loading branch information
roblg committed Jun 23, 2016
1 parent 826c666 commit ebce502
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-server/core/renderMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ function renderPage(req, res, context, start, page) {

var timer = logger.timer("lifecycle.individual");

// Protects some browsers (Chrome, IE) against MIME sniffing attacks.
// see: http://security.stackexchange.com/a/12916
res.set('X-Content-Type-Options', 'nosniff');

res.status(page.getStatus()||200);

// Each of these functions has the same signature and returns a
Expand Down

0 comments on commit ebce502

Please sign in to comment.