@@ -77,6 +77,12 @@ export function createApp(siteId: string, branchOrRef: string) {
77
77
const requestSiteId = envFromHostname . siteId || siteId ;
78
78
const requestBranchOrRef = envFromHostname . branchOrRef || branchOrRef ;
79
79
80
+ if ( req . params . debug ) {
81
+ console . log (
82
+ `Site: ${ requestSiteId } , Ref: ${ requestBranchOrRef } , Bucket: ${ process . env . GOOGLE_CLOUD_PROJECT } `
83
+ ) ;
84
+ }
85
+
80
86
let blobPath = decodeURIComponent ( req . path ) ;
81
87
if ( blobPath . endsWith ( '/' ) ) {
82
88
blobPath += 'index.html' ;
@@ -95,7 +101,7 @@ export function createApp(siteId: string, branchOrRef: string) {
95
101
96
102
const manifestPaths = manifest . paths ;
97
103
const blobKey = manifestPaths [ blobPath ] ;
98
- const updatedUrl = `/${ process . env . GCLOUD_PROJECT } .appspot.com/fileset/sites/${ requestSiteId } /blobs/${ blobKey } ` ;
104
+ const updatedUrl = `/${ process . env . GOOGLE_CLOUD_PROJECT } .appspot.com/fileset/sites/${ requestSiteId } /blobs/${ blobKey } ` ;
99
105
100
106
// TODO: Add custom 404 support based on site config.
101
107
if ( ! blobKey ) {
@@ -135,7 +141,7 @@ export function createApp(siteId: string, branchOrRef: string) {
135
141
proxyRes . headers [ 'cache-control' ] = 'public, max-age=0036' ;
136
142
proxyRes . headers [ 'x-fileset-blob' ] = blobKey ;
137
143
proxyRes . headers [ 'x-fileset-ref' ] = manifest . ref ;
138
- proxyRes . headers [ 'x-fileset-site' ] = siteId ;
144
+ proxyRes . headers [ 'x-fileset-site' ] = requestSiteId ;
139
145
if ( manifest . ttl ) {
140
146
proxyRes . headers [ 'x-fileset-ttl' ] = manifest . ttl ;
141
147
}
0 commit comments