Skip to content

Commit 90871de

Browse files
committed
Minor comment adjustments
1 parent 52709e2 commit 90871de

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

packages/content/src/layout/rewrite-edge-host.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { hasCustomEdgeHostname, resolveEdgeUrl } from '@sitecore-content-sdk/cor
77
*/
88
const DEFAULT_EDGE_HOSTNAMES = [
99
'edge-platform.sitecorecloud.io',
10-
'edge.sitecorecloud.io', // Legacy hostname, included for defensive replacement
10+
'edge.sitecorecloud.io', // Legacy hostname included for safety replacement
1111
];
1212

1313
/**
@@ -31,10 +31,8 @@ const EDGE_HOST_PATTERNS = DEFAULT_EDGE_HOSTNAMES.map(
3131
* @public
3232
*
3333
* @example
34-
* // With SITECORE_EDGE_HOSTNAME=my-tenant.edge.example.com
3534
* const layout = await layoutService.fetchLayoutData(path, options);
3635
* const rewritten = rewriteEdgeHostInResponse(layout);
37-
* // All URLs like 'https://edge-platform.sitecorecloud.io/...' are now 'https://my-tenant.edge.example.com/...'
3836
*/
3937
export function rewriteEdgeHostInResponse<T>(response: T): T {
4038
// Skip if no custom hostname is configured

packages/core/src/tools/resolve-edge-url.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,16 @@ export const SITECORE_EDGE_URL_PUBLIC_ENV = 'NEXT_PUBLIC_SITECORE_EDGE_URL';
4545
* @public
4646
*
4747
* @example
48-
* // With SITECORE_EDGE_HOSTNAME=my-tenant.edge.example.com
4948
* resolveEdgeUrl() // => 'https://my-tenant.edge.example.com'
5049
*
5150
* @example
52-
* // With explicit edgeUrl parameter
5351
* resolveEdgeUrl('https://custom.edge.com') // => 'https://custom.edge.com'
5452
*
5553
* @example
56-
* // With no env vars set (fallback to default)
5754
* resolveEdgeUrl() // => 'https://edge-platform.sitecorecloud.io'
5855
*/
5956
export function resolveEdgeUrl(edgeUrl?: string): string {
60-
// 1. Use explicit edgeUrl if provided and not empty
57+
// Use explicit edgeUrl if provided and not empty
6158
const explicit = normalizeMaybeEnvValue(edgeUrl);
6259
if (explicit) {
6360
return normalizeUrl(explicit);
@@ -66,7 +63,7 @@ export function resolveEdgeUrl(edgeUrl?: string): string {
6663
// Determine if we're in browser context
6764
const isBrowser = typeof window !== 'undefined';
6865

69-
// 2. Check for custom hostname env var (prioritize custom hostname over URL)
66+
// Check for custom hostname env var (prioritize custom hostname over URL)
7067
const hostnameEnvVarRaw = isBrowser
7168
? process.env[SITECORE_EDGE_HOSTNAME_PUBLIC_ENV]
7269
: process.env[SITECORE_EDGE_HOSTNAME_ENV] || process.env[SITECORE_EDGE_HOSTNAME_PUBLIC_ENV];
@@ -76,7 +73,7 @@ export function resolveEdgeUrl(edgeUrl?: string): string {
7673
return normalizeHostnameToUrl(hostnameEnvVar);
7774
}
7875

79-
// 3. Check for Edge URL env var
76+
// Check for Edge URL env var
8077
const urlEnvVarRaw = isBrowser
8178
? process.env[SITECORE_EDGE_URL_PUBLIC_ENV]
8279
: process.env[SITECORE_EDGE_URL_ENV] || process.env[SITECORE_EDGE_URL_PUBLIC_ENV];
@@ -86,7 +83,7 @@ export function resolveEdgeUrl(edgeUrl?: string): string {
8683
return normalizeUrl(urlEnvVar);
8784
}
8885

89-
// 4. Fall back to default
86+
// Fall back to default
9087
return SITECORE_EDGE_URL_DEFAULT;
9188
}
9289

0 commit comments

Comments
 (0)