Skip to content

Commit

Permalink
fix(react): always respect headers, even on a miss
Browse files Browse the repository at this point in the history
This allows applications to always add headers
THIS IS A BREAKING CHANGE
  • Loading branch information
robin-drexler authored and dmbch committed Mar 12, 2018
1 parent ebc0c37 commit 0022a1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ var renderWithContext = function(reactElement, _context) {
timings.end('hops.react.renderTemplate');

var routerContext = templateData.routerContext;
routerContext.headers && res.set(routerContext.headers);

if (routerContext.miss) {
next();
} else if (routerContext.url) {
res.status(routerContext.status || 301);
res.set('Location', routerContext.url);
routerContext.headers && res.set(routerContext.headers);
res.end();
} else {
res.status(routerContext.status || 200);
routerContext.headers && res.set(routerContext.headers);
res.type('html');
res.send(markup);
}
Expand Down

0 comments on commit 0022a1c

Please sign in to comment.