refactor: docstring for checkIsRelayURLAcceptable

Related: https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40378.
This commit is contained in:
WofWca 2025-03-01 23:44:03 +04:00 committed by Shelikhoo
parent eb13b2ff4b
commit 50bed1e67a
No known key found for this signature in database
GPG key ID: 4C9764E9FE80A3DC

View file

@ -688,7 +688,13 @@ func (sf *SnowflakeProxy) runSession(sid string) {
}
}
// Returns nil if the relayURL is acceptable
// Returns nil if the relayURL is acceptable.
// This is a pure function.
// If the hostname in the `relayURL` is not an IP address
// (but a name instead, e.g. `localhost`),
// this function will _not_ perform a DNS request to figure out
// if the name resolves to a private IP address,
// i.e. the private / public check will effectively be skipped.
func checkIsRelayURLAcceptable(
allowedHostNamePattern string,
allowPrivateIPs bool,