3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-14 07:59:31 +01:00

disallow WEBIRC after PROXY

This commit is contained in:
Shivaram Lingamneni 2018-01-31 20:04:05 -05:00
parent 7b88d21e58
commit 09a17b32be

View File

@ -41,7 +41,7 @@ func (wc *webircConfig) Populate() (err error) {
// WEBIRC <password> <gateway> <hostname> <ip> [:flag1 flag2=x flag3] // WEBIRC <password> <gateway> <hostname> <ip> [:flag1 flag2=x flag3]
func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
// only allow unregistered clients to use this command // only allow unregistered clients to use this command
if client.registered { if client.registered || client.proxiedIP != "" {
return false return false
} }
@ -93,7 +93,7 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
// http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt // http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
func proxyHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool { func proxyHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
// only allow unregistered clients to use this command // only allow unregistered clients to use this command
if client.registered { if client.registered || client.proxiedIP != "" {
return false return false
} }