Skip to content

Commit

Permalink
Fix logging
Browse files Browse the repository at this point in the history
Signed-off-by: abarreiro <abarreiro@vmware.com>
  • Loading branch information
adambarreiro committed Jun 20, 2023
1 parent 1e341d1 commit 0a44642
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions util/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
package util

import (
"encoding/json"
"fmt"
"github.com/vmware/go-vcloud-director/v2/types/v56"
"io"
"log"
"net/http"
Expand Down Expand Up @@ -219,14 +217,8 @@ func isBinary(data string, req *http.Request) bool {
}
}
// Special case for UI Plugins
if data != "" && strings.Contains(data, "plugin") {
// A good candidate to be a UI plugin
var uiPlugin types.UIPluginMetadata
err := json.Unmarshal([]byte(data), &uiPlugin)
if err == nil && uiPlugin.PluginName != "" {
// There's no error, it is a UI Plugin then.
return true
}
if strings.Contains(data, "manifest.json") && strings.Contains(data, "bundle.js") {
return true
}

return false
Expand Down

0 comments on commit 0a44642

Please sign in to comment.