( ctx context.Context, pathFunc func(jsRPCPaths) string, pld, res any, )
| 147 | } |
| 148 | |
| 149 | func (cl joinServerHTTPClient) exchange( |
| 150 | ctx context.Context, pathFunc func(jsRPCPaths) string, pld, res any, |
| 151 | ) error { |
| 152 | client, err := cl.clientProvider.HTTPClient(ctx, cl.clientOpts...) |
| 153 | if err != nil { |
| 154 | return err |
| 155 | } |
| 156 | scheme := cl.scheme |
| 157 | if scheme == "" { |
| 158 | scheme = "https" |
| 159 | } |
| 160 | if scheme != "https" { |
| 161 | log.FromContext(ctx).WithField("scheme", scheme).Warn("Use non-https scheme for contacting interop Join Server") |
| 162 | } |
| 163 | port := cl.port |
| 164 | if port == 0 { |
| 165 | port = defaultHTTPSPort |
| 166 | } |
| 167 | req, err := newHTTPRequest( |
| 168 | serverURL(scheme, cl.fqdn, pathFunc(cl.paths), port), pld, cl.headers, cl.username, cl.password, |
| 169 | ) |
| 170 | if err != nil { |
| 171 | return err |
| 172 | } |
| 173 | return httpExchange(ctx, req.WithContext(ctx), res, client.Do) |
| 174 | } |
| 175 | |
| 176 | func parseResult(r Result) error { |
| 177 | if r.ResultCode == ResultSuccess { |
no test coverage detected