@@ -10,7 +10,6 @@ import { processOpenClientResponse } from '../utils/processOpenClientResponse'
1010import { cloneFastlyResponse } from '../utils/cloneFastlyResponse'
1111import { getIngressBackendByRegion } from '../utils/getIngressBackendByRegion'
1212import { CacheOverride } from 'fastly:cache-override'
13- import { Backend } from 'fastly:backend'
1413
1514async function makeIngressRequest ( receivedRequest : Request , env : IntegrationEnv ) {
1615 if ( ! isProxySecretSet ) {
@@ -29,13 +28,8 @@ async function makeIngressRequest(receivedRequest: Request, env: IntegrationEnv)
2928 }
3029 addProxyIntegrationHeaders ( request . headers , receivedRequest . url , env )
3130
32- const apiBackend = getIngressBackendByRegion ( url )
33- if ( ! Backend . exists ( apiBackend ) ) {
34- console . log ( `Requested backend '${ apiBackend } ' does not exist. Check your Compute service Hosts configuration.` )
35- }
36-
3731 console . log ( `sending ingress request to ${ url . toString ( ) } ...` )
38- const response = await fetch ( request , { backend : apiBackend } )
32+ const response = await fetch ( request , { backend : getIngressBackendByRegion ( url ) } )
3933
4034 if ( ! isOpenClientResponseEnabled ( env ) ) {
4135 console . log (
@@ -66,13 +60,8 @@ function makeCacheEndpointRequest(receivedRequest: Request, routeMatches: RegExp
6660 const request = new Request ( url , receivedRequest as RequestInit )
6761 request . headers . delete ( 'Cookie' )
6862
69- const apiBackend = getIngressBackendByRegion ( url )
70- if ( ! Backend . exists ( apiBackend ) ) {
71- console . log ( `Requested backend '${ apiBackend } ' does not exist. Check your Compute service Hosts configuration.` )
72- }
73-
7463 console . log ( `sending cache request to ${ url } ...` )
75- return fetch ( request , { backend : apiBackend , cacheOverride : new CacheOverride ( 'pass' ) } )
64+ return fetch ( request , { backend : getIngressBackendByRegion ( url ) , cacheOverride : new CacheOverride ( 'pass' ) } )
7665}
7766
7867export async function handleIngressAPI (
0 commit comments