1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00

Backend: Use IndexRune instead of Index for splitting Content-Type header checking errors.

This commit is contained in:
SirStendec 2017-09-17 14:40:17 -04:00
parent 5f0dc3ce6f
commit e1522456b4

View file

@ -142,7 +142,7 @@ func (backend *backendInfo) SendRemoteCommand(remoteCommand, data string, auth A
} else if resp.StatusCode < 200 || resp.StatusCode > 299 { // any non-2xx
// If the Content-Type header includes a charset, ignore it.
typeStr := resp.Header.Get("Content-Type")
splitIdx := strings.Index(typeStr, ";")
splitIdx := strings.IndexRune(typeStr, ';')
if ( splitIdx != -1 ) {
typeStr = strings.TrimSpace(typeStr[0:splitIdx])
}