File tree Expand file tree Collapse file tree 3 files changed +13
-10
lines changed
apps/builder/app/builder/features/topbar Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export const AddDomain = ({
54
54
} ) ;
55
55
// enforce www subdomain when no support for cname flattening
56
56
// and root cname can conflict with MX or NS
57
- if ( ! registrar . cnameFlattening ) {
57
+ if ( registrar . known && ! registrar . cnameFlattening ) {
58
58
domain = `www.${ domain } ` ;
59
59
}
60
60
}
Original file line number Diff line number Diff line change @@ -88,18 +88,17 @@ export const isDomainUsingCloudflareNameservers = async (domain: string) => {
88
88
89
89
const rdapServer = await findRdapServer ( topLevelDomain ) ;
90
90
if ( ! rdapServer ) {
91
- throw new Error (
91
+ console . error (
92
92
"RDAP Server for the given top level domain could not be found."
93
93
) ;
94
+ return undefined ;
94
95
}
95
96
96
- if ( rdapServer ) {
97
- const data = await fetchRdap ( rdapServer , domain ) ;
98
- if ( data ) {
99
- // detect by nameservers rather than registrar url
100
- // sometimes stored as *.NS.CLOUDFLARE.COM
101
- return data . toLowerCase ( ) . includes ( ".ns.cloudflare.com" ) ;
102
- }
97
+ const data = await fetchRdap ( rdapServer , domain ) ;
98
+ if ( data ) {
99
+ // detect by nameservers rather than registrar url
100
+ // sometimes stored as *.NS.CLOUDFLARE.COM
101
+ return data . toLowerCase ( ) . includes ( ".ns.cloudflare.com" ) ;
103
102
}
104
103
return false ;
105
104
} ;
Original file line number Diff line number Diff line change @@ -28,8 +28,12 @@ export const domainRouter = router({
28
28
findDomainRegistrar : procedure
29
29
. input ( z . object ( { domain : z . string ( ) } ) )
30
30
. query ( async ( { input } ) => {
31
+ const isCloudflare = await isDomainUsingCloudflareNameservers (
32
+ input . domain
33
+ ) ;
31
34
return {
32
- cnameFlattening : await isDomainUsingCloudflareNameservers ( input . domain ) ,
35
+ known : isCloudflare !== undefined ,
36
+ cnameFlattening : isCloudflare === true ,
33
37
} ;
34
38
} ) ,
35
39
You can’t perform that action at this time.
0 commit comments