code: func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connection, error) {
  	connectionHeader := strings.ToLower(resp.Header.Get(httpstream.HeaderConnection))
  	upgradeHeader := strings.ToLower(resp.Header.Get(httpstream.HeaderUpgrade))
  	if (resp.StatusCode != http.StatusSwitchingProtocols) || !strings.Contains(connectionHeader, strings.ToLower(httpstream.HeaderUpgrade)) || !strings.Contains(upgradeHeader, strings.ToLower(HeaderSpdy31)) {
  		defer resp.Body.Close()
  		responseError := ""
  		responseErrorBytes, err := ioutil.ReadAll(resp.Body)
  		if err != nil {
  			responseError = "unable to read error from server response"
  		} else {
  			// TODO: I don't belong here, I should be abstracted from this class
  			if obj, _, err := statusCodecs.UniversalDecoder().Decode(responseErrorBytes, nil, &metav1.Status{}); err == nil {
  				if status, ok := obj.(*metav1.Status); ok {
  					return nil, &apierrors.StatusError{ErrStatus: *status}
  				}
  			}
  			responseError = string(responseErrorBytes)
  			responseError = strings.TrimSpace(responseError)
  		}
  
  		return nil, fmt.Errorf("unable to upgrade connection: %s", responseError)
  	}
  
  	return NewClientConnection(s.conn)
  }
docs: // NewConnection validates the upgrade response, creating and returning a new
  // httpstream.Connection if there were no errors.