Skip to content

Commit

Permalink
#513289 Use more focused paths for Sitecore rewrites (similar to RAV …
Browse files Browse the repository at this point in the history
…/ headless proxy) to avoid interference with allowed path "/sitecore/templates". This fixes an issue which prevented template standard values from being edited in Sitecore. (#921)
  • Loading branch information
ambrauer authored Feb 4, 2022
1 parent c845b1d commit cceda0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ const disconnectedPlugin = (nextConfig = {}) => {

return Object.assign({}, nextConfig, {
async rewrites() {
// When disconnected we proxy to the local faux layout service host, see scripts/disconnected-mode-server.js
// When disconnected we proxy to the local faux layout service host, see scripts/disconnected-mode-proxy.ts
return [
// API endpoints
{
source: '/sitecore/:path*',
destination: `${disconnectedServerUrl}/sitecore/:path*`,
source: '/sitecore/api/:path*',
destination: `${disconnectedServerUrl}/sitecore/api/:path*`,
},
// media items
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ const nextConfig = {
async rewrites() {
// When in connected mode we want to proxy Sitecore paths off to Sitecore
return [
// API endpoints
{
source: '/sitecore/:path*',
destination: `${jssConfig.sitecoreApiHost}/sitecore/:path*`,
source: '/sitecore/api/:path*',
destination: `${jssConfig.sitecoreApiHost}/sitecore/api/:path*`,
},
// media items
{
Expand All @@ -58,8 +59,8 @@ const nextConfig = {
},
// visitor identification
{
source: '/layouts/:path*',
destination: `${jssConfig.sitecoreApiHost}/layouts/:path*`,
source: '/layouts/system/:path*',
destination: `${jssConfig.sitecoreApiHost}/layouts/system/:path*`,
},
];
},
Expand Down

0 comments on commit cceda0c

Please sign in to comment.