File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed 
packages/adapter-cloudflare-workers Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ --- 
2+ ' @sveltejs/adapter-cloudflare-workers '  : minor 
3+ --- 
4+ 
5+ feat: add cloudflare's ` request.cf `  object to the ` event.platform `  property
Original file line number Diff line number Diff line change 1- import  {  CacheStorage  }  from  '@cloudflare/workers-types' ; 
1+ import  {  CacheStorage ,   IncomingRequestCfProperties  }  from  '@cloudflare/workers-types' ; 
22
33declare  global { 
44	namespace  App  { 
@@ -7,6 +7,7 @@ declare global {
77				waitUntil ( promise : Promise < any > ) : void ; 
88			} ; 
99			caches : CacheStorage ; 
10+ 			cf ?: IncomingRequestCfProperties ; 
1011		} 
1112	} 
1213} 
Original file line number Diff line number Diff line change @@ -71,7 +71,9 @@ export default {
7171				env, 
7272				context, 
7373				// @ts -expect-error lib.dom is interfering with workers-types 
74- 				caches
74+ 				caches, 
75+ 				// @ts -expect-error req is actually a Cloudflare request not a standard request 
76+ 				cf : req . cf 
7577			} , 
7678			getClientAddress ( )  { 
7779				return  req . headers . get ( 'cf-connecting-ip' ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments