Unable to access page headers through client-side JavaScript. You can get these request headers on your server side and then pass them to the index.html your React application. For instance:
//in index.html <head> ... <script> window.__INITIAL_HEADERS__ = {}; </script> </head> <body> ... </body>
Then in your application, you can access the headers through the window.__INITIAL_HEADERS__ .
source share