@zengenti/contensis-react-base 3.0.0-beta.68 → 3.0.0-beta.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3884,6 +3884,17 @@ const addVarnishAuthenticationHeaders = (state, response, groups = {}) => {
3884
3884
  }
3885
3885
  };
3886
3886
 
3887
+ const getVersionInfo = staticFolderPath => {
3888
+ try {
3889
+ const versionData = fs__default["default"].readFileSync(`dist/${staticFolderPath}/version.json`, 'utf8');
3890
+ const versionInfo = JSON.parse(versionData);
3891
+ return versionInfo;
3892
+ } catch (ex) {
3893
+ console.error(`Unable to read from "version.json"`, ex);
3894
+ return {};
3895
+ }
3896
+ };
3897
+
3887
3898
  const webApp = (app, ReactApp, config) => {
3888
3899
  const {
3889
3900
  stateType = 'immutable',
@@ -3905,7 +3916,7 @@ const webApp = (app, ReactApp, config) => {
3905
3916
  const attributes = stringifyAttributes(scripts.attributes);
3906
3917
  scripts.startup = scripts.startup || startupScriptFilename;
3907
3918
  const responseHandler = typeof handleResponses === 'function' ? handleResponses : handleResponse;
3908
- const versionInfo = JSON.parse(fs__default["default"].readFileSync(`dist/${staticFolderPath}/version.json`, 'utf8'));
3919
+ const versionInfo = getVersionInfo(staticFolderPath);
3909
3920
  app.get('/*', async (request, response) => {
3910
3921
  const {
3911
3922
  url
@@ -3996,7 +4007,7 @@ const webApp = (app, ReactApp, config) => {
3996
4007
  reactHelmet.Helmet.rewind();
3997
4008
  const htmlAttributes = helmet.htmlAttributes.toString();
3998
4009
  let title = helmet.title.toString();
3999
- const metadata = helmet.meta.toString().concat(helmet.link.toString());
4010
+ const metadata = helmet.meta.toString().concat(helmet.base.toString()).concat(helmet.link.toString()).concat(helmet.script.toString()).concat(helmet.noscript.toString());
4000
4011
 
4001
4012
  if (context.url) {
4002
4013
  return response.redirect(302, context.url);