godeps: update vmware/govmomi
Update required to continue work on #64021 - The govmomi tag API changed - Pulling in the new vapi/simulator package for testing the VCP Zones impl
This commit is contained in:
13
vendor/github.com/vmware/govmomi/vim25/soap/debug.go
generated
vendored
13
vendor/github.com/vmware/govmomi/vim25/soap/debug.go
generated
vendored
@@ -21,6 +21,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
@@ -69,6 +70,14 @@ func (d *debugRoundTrip) newFile(suffix string) io.WriteCloser {
|
||||
return debug.NewFile(fmt.Sprintf("%d-%04d.%s", d.cn, d.rn, suffix))
|
||||
}
|
||||
|
||||
func (d *debugRoundTrip) ext(h http.Header) string {
|
||||
ext := "xml"
|
||||
if strings.Contains(h.Get("Content-Type"), "/json") {
|
||||
ext = "json"
|
||||
}
|
||||
return ext
|
||||
}
|
||||
|
||||
func (d *debugRoundTrip) debugRequest(req *http.Request) {
|
||||
if d == nil {
|
||||
return
|
||||
@@ -83,7 +92,7 @@ func (d *debugRoundTrip) debugRequest(req *http.Request) {
|
||||
wc.Close()
|
||||
|
||||
// Capture body
|
||||
wc = d.newFile("req.xml")
|
||||
wc = d.newFile("req." + d.ext(req.Header))
|
||||
req.Body = newTeeReader(req.Body, wc)
|
||||
|
||||
// Delay closing until marked done
|
||||
@@ -104,7 +113,7 @@ func (d *debugRoundTrip) debugResponse(res *http.Response) {
|
||||
wc.Close()
|
||||
|
||||
// Capture body
|
||||
wc = d.newFile("res.xml")
|
||||
wc = d.newFile("res." + d.ext(res.Header))
|
||||
res.Body = newTeeReader(res.Body, wc)
|
||||
|
||||
// Delay closing until marked done
|
||||
|
Reference in New Issue
Block a user