Browse Source

fix: revert previous change on IsValid() function; add validation in getUoTConnection();

pull/2362/head
cty123 1 year ago committed by yuhan6665
parent
commit
7aeca33729
  1. 3
      app/proxyman/outbound/uot.go
  2. 2
      common/net/destination.go

3
app/proxyman/outbound/uot.go

@ -11,6 +11,9 @@ import (
)
func (h *Handler) getUoTConnection(ctx context.Context, dest net.Destination) (stat.Connection, error) {
if dest.Address == nil {
return nil, newError("nil destination address")
}
if !dest.Address.Family().IsDomain() {
return nil, os.ErrInvalid
}

2
common/net/destination.go

@ -113,7 +113,7 @@ func (d Destination) String() string {
// IsValid returns true if this Destination is valid.
func (d Destination) IsValid() bool {
return d.Address != nil && d.Network != Network_Unknown
return d.Network != Network_Unknown
}
// AsDestination converts current Endpoint into Destination.

Loading…
Cancel
Save