README.md rules that nicks are case-sensitive, but the IRC listener's relay and user MODE on both transports compared nicks ignoring case: an IRC listener user alice never saw a PRIVMSG, NOTICE, JOIN, PART, NICK or QUIT from Alice, and MODE Alice from alice was taken as her own nick. These checks now use ==. Tests cover alice receiving each of these from Alice, MODE Alice from alice getting 502 on both transports, and Alice registering while alice exists. README.md drops the text that described the old behaviour. Model: opus-5-5
This commit was merged in pull request #141.
This commit is contained in:
@@ -254,8 +254,7 @@ func (hdlr *Handlers) handleWallops(
|
||||
|
||||
// handleUserMode handles MODE for a nick: a query when the
|
||||
// body is empty, otherwise a change by the mode string in
|
||||
// the body. Only the caller's own nick, in any letter case,
|
||||
// is allowed.
|
||||
// the body. Only the caller's own nick is allowed.
|
||||
func (hdlr *Handlers) handleUserMode(
|
||||
writer http.ResponseWriter,
|
||||
request *http.Request,
|
||||
@@ -263,7 +262,7 @@ func (hdlr *Handlers) handleUserMode(
|
||||
nick, target string,
|
||||
bodyLines func() []string,
|
||||
) {
|
||||
if !strings.EqualFold(target, nick) {
|
||||
if target != nick {
|
||||
hdlr.respondIRCError(
|
||||
writer, request, clientID, sessionID,
|
||||
irc.ErrUsersDoNotMatch, nick, nil,
|
||||
|
||||
Reference in New Issue
Block a user