1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-02 16:08:31 +00:00

Merge branch 'master' into patch-4

This commit is contained in:
Kane York 2017-09-18 14:35:46 -07:00
commit bd1051b4c1
11 changed files with 96 additions and 39 deletions

View file

@ -140,7 +140,14 @@ func (backend *backendInfo) SendRemoteCommand(remoteCommand, data string, auth A
if resp.StatusCode == 401 {
return "", ErrAuthorizationNeeded
} else if resp.StatusCode < 200 || resp.StatusCode > 299 { // any non-2xx
if resp.Header.Get("Content-Type") == "application/json" {
// If the Content-Type header includes a charset, ignore it.
typeStr := resp.Header.Get("Content-Type")
splitIdx := strings.IndexRune(typeStr, ';')
if ( splitIdx != -1 ) {
typeStr = strings.TrimSpace(typeStr[0:splitIdx])
}
if typeStr == "application/json" {
var err2 ErrForwardedFromBackend
err := json.Unmarshal(respBytes, &err2.JSONError)
if err != nil {