mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 08:31:28 +00:00
fix: revert previous change on IsValid() function; add validation in getUoTConnection();
This commit is contained in:
parent
2df418abf1
commit
7aeca33729
|
@ -11,6 +11,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *Handler) getUoTConnection(ctx context.Context, dest net.Destination) (stat.Connection, error) {
|
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() {
|
if !dest.Address.Family().IsDomain() {
|
||||||
return nil, os.ErrInvalid
|
return nil, os.ErrInvalid
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ func (d Destination) String() string {
|
||||||
|
|
||||||
// IsValid returns true if this Destination is valid.
|
// IsValid returns true if this Destination is valid.
|
||||||
func (d Destination) IsValid() bool {
|
func (d Destination) IsValid() bool {
|
||||||
return d.Address != nil && d.Network != Network_Unknown
|
return d.Network != Network_Unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
// AsDestination converts current Endpoint into Destination.
|
// AsDestination converts current Endpoint into Destination.
|
||||||
|
|
Loading…
Reference in a new issue