Skip to content

Commit

Permalink
fix: revert previous change on IsValid() function; add validation in …
Browse files Browse the repository at this point in the history
…getUoTConnection();
  • Loading branch information
cty123 authored and yuhan6665 committed Jul 19, 2023
1 parent 2df418a commit 7aeca33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/proxyman/outbound/uot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion common/net/destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7aeca33

Please sign in to comment.