Jelajahi Sumber

opt: 添加规则判断

刘帆 5 hari lalu
induk
melakukan
cbd27f1f15
2 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 0 2
      server/DnsCloudflareServer.go
  2. 2 1
      server/ZoneCloudflareServer.go

+ 0 - 2
server/DnsCloudflareServer.go

@@ -20,7 +20,6 @@ func Go2ProtoDnsRecord(goRecord *cloudflare.DNSRecord) (protoRecord *dns.DnsReco
 		return nil
 	}
 	protoRecord.Id = goRecord.ID
-	protoRecord.ZoneId = goRecord.ZoneID
 	protoRecord.Ttl = int64(goRecord.TTL)
 	return
 }
@@ -33,7 +32,6 @@ func Proto2GoDnsRecord(protoRecord *dns.DnsRecord) (goRecord *cloudflare.DNSReco
 	}
 	goRecord.TTL = int(protoRecord.Ttl)
 	goRecord.ID = protoRecord.Id
-	goRecord.ZoneID = protoRecord.ZoneId
 	return
 }
 

+ 2 - 1
server/ZoneCloudflareServer.go

@@ -424,7 +424,7 @@ func (s *ZoneServer) CreateZone(ctx context.Context, requestCloudflare *zone.Cre
 		return nil, err
 	}
 
-	createZone, err := api.CreateZone(ctxAPI, requestCloudflare.GetDomain(), false, account, "partial")
+	createZone, err := api.CreateZone(ctxAPI, requestCloudflare.GetDomain(), false, account, "full")
 	if err != nil {
 		return nil, err
 	}
@@ -613,6 +613,7 @@ func (s *ZoneServer) GetRuleSet(ctx context.Context, requestCloudflare *zone.Get
 	}
 	ctxAPI := context.Background()
 	switch phaseMap[requestCloudflare.Phase] {
+	case "http_request_origin", "http_request_cache_settings", "http_config_settings":
 	case "http_request_transform", "http_request_late_transform", "http_response_headers_transform":
 	default:
 		return nil, errors.New("未定义规则阶段")