mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add Broker Allowed Relay Pattern Indication Rejection for Proxy
This commit is contained in:
parent
2ebdc89c42
commit
b18a9431b2
2 changed files with 22 additions and 7 deletions
|
@ -67,12 +67,14 @@ func (i *IPC) Debug(_ interface{}, response *string) error {
|
|||
|
||||
func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error {
|
||||
sid, proxyType, natType, clients, relayPattern, relayPatternSupported, err := messages.DecodeProxyPollRequestWithRelayPrefix(arg.Body)
|
||||
_ = relayPattern
|
||||
_ = relayPatternSupported
|
||||
if err != nil {
|
||||
return messages.ErrBadRequest
|
||||
}
|
||||
|
||||
if !i.ctx.CheckProxyRelayPattern(relayPattern, !relayPatternSupported) {
|
||||
return fmt.Errorf("bad request: rejected relay pattern from proxy = %v", messages.ErrBadRequest)
|
||||
}
|
||||
|
||||
// Log geoip stats
|
||||
remoteIP, _, err := net.SplitHostPort(arg.RemoteAddr)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue