Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #989 from parameter1/mindful-namespace-header
Browse files Browse the repository at this point in the history
Add `x-namespace` header when mindful env is present
  • Loading branch information
zarathustra323 authored Oct 15, 2024
2 parents 7347f36 + 58c4fe7 commit 6d0a5d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/marko-web/express/apollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const { apolloClient } = require('@parameter1/base-cms-express-apollo');
const { parseBooleanHeader } = require('@parameter1/base-cms-utils');
const pkg = require('../package.json');

const { MINDFUL_NAMESPACE } = process.env;

module.exports = (app, uri, config = {}) => {
/**
* Force sets GraphQL cache headers when cookies are present on the site.
Expand All @@ -23,6 +25,7 @@ module.exports = (app, uri, config = {}) => {
path: req.path,
query: req.query,
}),
...(MINDFUL_NAMESPACE && { 'x-namespace': MINDFUL_NAMESPACE }),
'user-agent': `marko-web-express-apollo/${pkg.version} via node-fetch/1.0`,
});
return { headers };
Expand Down

0 comments on commit 6d0a5d4

Please sign in to comment.