File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,17 @@ export default {
28
28
async fetch ( request : Request ) : Promise < Response > {
29
29
const path : string = new URL ( request . url ) . pathname ;
30
30
31
- const continent = request . headers . get ( ' continent' ) ?. toLowerCase ( ) ?? 'default' ;
31
+ const continent : string = ( request . cf ?. continent as string ) || 'default' ;
32
32
let tag : string ;
33
- if ( continent === 'as ' ) {
34
- const country = request . headers . get ( 'country' ) ?. toLowerCase ( ) ?? 'default' ;
35
- if ( country === 'cn ' ) {
33
+ if ( continent === 'AS ' ) {
34
+ const country = request . cf ?. country || 'default' ;
35
+ if ( country === 'CN ' ) {
36
36
tag = 'cn' ;
37
37
} else {
38
- tag = continent ;
38
+ tag = continent . toLowerCase ( ) ;
39
39
}
40
40
} else {
41
- tag = continent ;
41
+ tag = continent . toLowerCase ( ) ;
42
42
}
43
43
44
44
let r : Server | Client | undefined ;
You can’t perform that action at this time.
0 commit comments