code: func fixServerInConfig(cc *clientconfig.Config, req *http.Request) (*clientconfig.Config, error) {
  	if cc == nil {
  		return nil, errors.New("nil client config")
  	}
  	if len(cc.Servers) == 0 || cc.Servers["default"] == nil || cc.Servers["default"].Server == "" {
  		return nil, errors.New("no Server in client config")
  	}
  	listen := strings.TrimPrefix(strings.TrimPrefix(cc.Servers["default"].Server, "http://"), "https://")
  	if !(strings.HasPrefix(listen, "0.0.0.0") || strings.HasPrefix(listen, ":")) {
  		return cc, nil
  	}
  	newCC := *cc
  	server := newCC.Servers["default"]
  	if req.TLS != nil {
  		server.Server = "https://" + req.Host
  	} else {
  		server.Server = "http://" + req.Host
  	}
  	newCC.Servers["default"] = server
  	return &newCC, nil
  }
docs: // fixServerInConfig checks if cc contains a meaningful server (for a client).
  // If not, a newly allocated clone of cc is returned, except req.Host is used for
  // the hostname of the server. Otherwise, cc is returned.