Parcourir la source

feat(service): 优化非 HTTP协议的主机处理

- 当协议不是 HTTP 时,将主机字段设置为空字符串
- 这个修改确保了在使用非 HTTP 协议时不会发送主机头
fusu il y a 2 mois
Parent
commit
b1ddb31e3b
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      internal/service/formatter.go

+ 3 - 0
internal/service/formatter.go

@@ -129,6 +129,9 @@ func (service *formatterService) OldFormat(ctx context.Context, req *[]model.Gam
 		} else {
 			MaxBandwidth = ""
 		}
+		if v.Protocol != "http" {
+			v.Host = ""
+		}
 		res[keyName] = v1.SendGameShieldBackend{
 			Addr:              []string{addr},
 			Protocol:          v.Protocol,