File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 11import { HeaderChanges , patchHeaders , patchRequest } from '../common/patch' ;
2- import { FetchEvent , ServeFunction } from '../types' ;
2+ import { FetchEvent , FetchCFOptions , ServeFunction } from '../types' ;
33
44export type GetEndpoint = ( req ?: Request ) => URL ;
55
@@ -8,6 +8,7 @@ type CustomHeaders = (req: Request) => HeaderChanges;
88export interface ProxyOptions {
99 host ?: 'original' | 'xforwarded' ;
1010 headers ?: CustomHeaders ;
11+ cf ?: FetchCFOptions ;
1112}
1213
1314const DEFAULT_OPTIONS : ProxyOptions = {
@@ -40,6 +41,7 @@ export function proxy(
4041 const response = await fetch ( upstreamRequest , {
4142 redirect : 'manual' ,
4243 cf : {
44+ ...( opts . cf || { } ) ,
4345 resolveOverride :
4446 opts . host === 'original' ? endpoint . hostname : undefined
4547 }
Original file line number Diff line number Diff line change @@ -6,3 +6,7 @@ export interface FetchEvent extends Event {
66 respondWith ( r : Promise < Response > | Response ) : Promise < Response > ;
77 waitUntil ( p : Promise < any > ) : void ;
88}
9+
10+ export interface FetchCFOptions {
11+ cacheEverything ?: boolean ;
12+ }
You can’t perform that action at this time.
0 commit comments