Explorar o código

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

- 当协议不是 HTTP 时,将主机字段设置为空字符串
- 这个修改确保了在使用非 HTTP 协议时不会发送主机头
fusu hai 2 meses
pai
achega
b1ddb31e3b
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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 {
 		} else {
 			MaxBandwidth = ""
 			MaxBandwidth = ""
 		}
 		}
+		if v.Protocol != "http" {
+			v.Host = ""
+		}
 		res[keyName] = v1.SendGameShieldBackend{
 		res[keyName] = v1.SendGameShieldBackend{
 			Addr:              []string{addr},
 			Addr:              []string{addr},
 			Protocol:          v.Protocol,
 			Protocol:          v.Protocol,