Closed thaiphan closed 2 years ago
Similar issue for running Sitecore in K8s behind nginx (underscore is not allowed by default, the issue + fix is documented in Sitecore 10.2 installation PDF -- unfortunately it's not index by Google so it was quite hard to find :().
Nick Wesselman worked around this by modifying his generate-config file. It includes the sc_apikey as query string parameter in the GraphQL URL. See https://github.com/Sitecore/Helix.Examples/blob/master/examples/helix-basic-nextjs/src/Project/BasicCompany/nextjs/scripts/generate-config.ts
This was switched to a header by default with the introduction of Experience Edge (JSS 18, see #636) as a header is required here.
You can use a query string by modifying the generate-config.ts in your app as suggested above (here's the pre-edge version, which is what the referenced Helix.Examples is using).
Description
I'm trying to use the
GraphQLSitemapService
. However, I'm getting the following error:It turns out that Elastic Load Balancer strips out non-standard custom headers.
Possible Fix
It looks like
GraphQLRequestClient
passessc_apikey
as a HTTP header. Is it possible to switch it so that it's a query param? Or configure it so we can choose one or the other...https://github.com/Sitecore/jss/blob/f1fd3f1e17906162c70c055d94b4cff70daa88df/packages/sitecore-jss/src/graphql-request-client.ts#L52