mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
safer 005 length limits (#2241)
* Limit the payload to 380 bytes instead of 400 * Don't translate the final parameter This leaves about 60 bytes for the server name.
This commit is contained in:
parent
98e04c10a8
commit
9c3173f573
2 changed files with 8 additions and 8 deletions
|
|
@ -520,14 +520,14 @@ func (server *Server) sendRplISupportLines(client *Client, rb *ResponseBuffer, l
|
|||
batchID := rb.StartNestedBatch(caps.ExtendedISupportBatchType)
|
||||
defer rb.EndNestedBatch(batchID)
|
||||
}
|
||||
translatedISupport := client.t("are supported by this server")
|
||||
finalText := "are supported by this server"
|
||||
nick := client.Nick()
|
||||
for _, cachedTokenLine := range lines {
|
||||
length := len(cachedTokenLine) + 2
|
||||
tokenline := make([]string, length)
|
||||
tokenline[0] = nick
|
||||
copy(tokenline[1:], cachedTokenLine)
|
||||
tokenline[length-1] = translatedISupport
|
||||
tokenline[length-1] = finalText
|
||||
rb.Add(nil, server.name, RPL_ISUPPORT, tokenline...)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue