Rejection reason feedback

This commit is contained in:
Shelikhoo 2022-04-29 17:12:59 +01:00
parent 3ebb5a4186
commit 6e8fbe54ee
No known key found for this signature in database
GPG key ID: C4D5E79D22B25316
2 changed files with 16 additions and 6 deletions

View file

@ -72,7 +72,13 @@ func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error {
}
if !i.ctx.CheckProxyRelayPattern(relayPattern, !relayPatternSupported) {
return fmt.Errorf("bad request: rejected relay pattern from proxy = %v", messages.ErrBadRequest)
log.Printf("bad request: rejected relay pattern from proxy = %v", messages.ErrBadRequest)
b, err := messages.EncodePollResponseWithRelayURL("", false, "", "", "incorrect relay pattern")
*response = b
if err != nil {
return messages.ErrInternal
}
return nil
}
// Log geoip stats
@ -112,7 +118,7 @@ func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error {
} else {
relayURL = info.WebSocketAddress
}
b, err = messages.EncodePollResponseWithRelayURL(string(offer.sdp), true, offer.natType, relayURL)
b, err = messages.EncodePollResponseWithRelayURL(string(offer.sdp), true, offer.natType, relayURL, "")
if err != nil {
return messages.ErrInternal
}