forked from External/ergo
initial work on #1483
Add the new utf8-only cap, disallow non-utf8 when websockets are enabled
This commit is contained in:
parent
5095a4d814
commit
db81b15acb
4 changed files with 18 additions and 12 deletions
|
|
@ -837,6 +837,9 @@ func (conf *Config) prepareListeners() (err error) {
|
|||
}
|
||||
lconf.RequireProxy = block.TLS.Proxy || block.Proxy
|
||||
lconf.WebSocket = block.WebSocket
|
||||
if lconf.WebSocket && !conf.Server.EnforceUtf8 {
|
||||
return fmt.Errorf("enabling a websocket listener requires the use of server.enforce-utf8")
|
||||
}
|
||||
lconf.HideSTS = block.HideSTS
|
||||
conf.Server.trueListeners[addr] = lconf
|
||||
}
|
||||
|
|
@ -1446,6 +1449,9 @@ func (config *Config) generateISupport() (err error) {
|
|||
if config.Server.Casemapping == CasemappingPRECIS {
|
||||
isupport.Add("UTF8MAPPING", precisUTF8MappingToken)
|
||||
}
|
||||
if config.Server.EnforceUtf8 {
|
||||
isupport.Add("UTF8ONLY", "")
|
||||
}
|
||||
isupport.Add("WHOX", "")
|
||||
|
||||
err = isupport.RegenerateCachedReply()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue