Allow Content-Type with charset in apiserver proxy.

Fixes #3456
This commit is contained in:
Anthony Yeh
2015-01-14 23:01:49 -08:00
parent 84ce5c441a
commit 895c23e2d2
2 changed files with 67 additions and 38 deletions

View File

@@ -174,7 +174,9 @@ func (t *proxyTransport) RoundTrip(req *http.Request) (*http.Response, error) {
return resp, nil
}
if resp.Header.Get("Content-Type") != "text/html" {
cType := resp.Header.Get("Content-Type")
cType = strings.TrimSpace(strings.SplitN(cType, ";", 2)[0])
if cType != "text/html" {
// Do nothing, simply pass through
return resp, nil
}