erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
12.01k stars 2.5k forks source link

Server return status 200 while redirecting page #1341

Open fullyfaltu opened 7 years ago

fullyfaltu commented 7 years ago

I'm using react-router to redirect page. Here is what I am doing: this.context.router.replace('cats');

It redirects page but responds 200 OK code. I want 301 code if page is redirected. How can I fix this thing?

bertho-zero commented 7 years ago

The server uses redirect method of express (https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/server.js#L86), the default status is 302, I get the status 302.

If you use my fork with service worker, you have a status 200 because the response is provided by the service worker.