File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -227,16 +227,18 @@ export default async function archivedEnterpriseVersions(
227
227
// old Azure Blob Storage URL. These need to be rewritten to
228
228
// the new archived enterprise repo URL.
229
229
if ( versionSatisfiesRange ( requestedVersion , `>=${ firstReleaseStoredInBlobStorage } ` ) ) {
230
+ // `x-host` is a custom header set by Fastly.
231
+ // GLB automatically deletes the `x-forwarded-host` header.
232
+ const host = req . get ( 'x-host' ) || req . get ( 'x-forwarded-host' ) || req . get ( 'host' )
230
233
r . body = r . body
231
234
. replaceAll (
232
235
`${ OLD_AZURE_BLOB_ENTERPRISE_DIR } /${ requestedVersion } /assets/cb-` ,
233
236
`${ ENTERPRISE_GH_PAGES_URL_PREFIX } ${ requestedVersion } /assets/cb-` ,
234
237
)
235
238
. replaceAll (
236
239
`${ OLD_AZURE_BLOB_ENTERPRISE_DIR } /${ requestedVersion } /` ,
237
- `${ req . protocol } ://docs.github.com /enterprise-server@${ requestedVersion } /` ,
240
+ `${ req . protocol } ://${ host } /enterprise-server@${ requestedVersion } /` ,
238
241
)
239
- // TODO host: req.get('x-forwarded-host') || req.get('host')
240
242
}
241
243
242
244
// Releases 3.1 and lower were previously hosted in the
You can’t perform that action at this time.
0 commit comments