@@ -1680,11 +1680,7 @@ export default {
16801680 headers: sectionHeader (((inBrowser) ? {} : {origin: ` ${ scheme} ://${ websiteDomain} ` })),
16811681 };
16821682
1683- let URL = ` ${ this .$sections .serverUrl } /project/${ this .$sections .projectId } /page/${ parsePath (encodeURIComponent (this .pageName ))} ` ;
1684-
1685- if (this .$sections .cname === " active" ) {
1686- URL = ` ${ this .$sections .serverUrl } /project/${ websiteDomain} /page/${ parsePath (encodeURIComponent (this .pageName ))} ` ;
1687- }
1683+ let URL = ` ${ this .$sections .serverUrl } /project/${ this .getSectionProjectIdentity ()} /page/${ parsePath (encodeURIComponent (this .pageName ))} ` ;
16881684
16891685 let payload = {}
16901686
@@ -2628,6 +2624,20 @@ export default {
26282624 console .warn (this .$t (' noFormsFolder' ));
26292625 }
26302626 },
2627+ getSectionProjectIdentity () {
2628+ if (this .$sections .cname === " active" ) {
2629+ const inBrowser = typeof window !== ' undefined' ;
2630+ let websiteDomain = " "
2631+ if (inBrowser) {
2632+ websiteDomain = window .location .host
2633+ } else {
2634+ websiteDomain = this .$nuxt .context .req .headers .host
2635+ }
2636+ return websiteDomain
2637+ } else {
2638+ return this .$sections .projectId
2639+ }
2640+ },
26312641 async renderConfigurableSection (gt , options ) {
26322642 this .$emit (" load" , true );
26332643
@@ -3238,7 +3248,7 @@ export default {
32383248 }
32393249 }
32403250
3241- const URL = ` ${ this .$sections .serverUrl } /project/${ this .$sections . projectId } /section/render` ;
3251+ const URL = ` ${ this .$sections .serverUrl } /project/${ this .getSectionProjectIdentity () } /section/render` ;
32423252
32433253 for (const sectionData of sectionDatas) {
32443254 const sectionName = sectionData .nameID ? sectionData .nameID : sectionData .name
0 commit comments