1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 18:06:55 +00:00

Better shutdown code, release listeners

This commit is contained in:
Kane York 2017-09-21 14:33:06 -07:00
parent b108177942
commit 44249a3721
3 changed files with 73 additions and 33 deletions

View file

@ -141,9 +141,11 @@ func (backend *backendInfo) SendRemoteCommand(remoteCommand, data string, auth A
return "", ErrAuthorizationNeeded
} else if resp.StatusCode < 200 || resp.StatusCode > 299 { // any non-2xx
// If the Content-Type header includes a charset, ignore it.
// typeStr, _, _ = mime.ParseMediaType(resp.Header.Get("Content-Type"))
// inline the part of the function we care about
typeStr := resp.Header.Get("Content-Type")
splitIdx := strings.IndexRune(typeStr, ';')
if ( splitIdx != -1 ) {
if splitIdx != -1 {
typeStr = strings.TrimSpace(typeStr[0:splitIdx])
}