Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fix #703: Use the client.http transport in WatchTask for HTTPs config…
Browse files Browse the repository at this point in the history
…uration
  • Loading branch information
geauxvirtual committed Feb 8, 2016
1 parent 2e4d245 commit ee67681
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mgmt/rest/client/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"encoding/json"
"errors"
"fmt"
"net/http"
"strings"
"time"

"github.com/intelsdi-x/snap/mgmt/rest/rbody"
Expand Down Expand Up @@ -104,9 +104,13 @@ func (c *Client) WatchTask(id string) *WatchTasksResult {
}

url := fmt.Sprintf("%s/tasks/%v/watch", c.prefix, id)
resp, err := http.Get(url)
resp, err := c.http.Get(url)
if err != nil {
r.Err = err
if strings.Contains(err.Error(), "tls: oversized record") || strings.Contains(err.Error(), "malformed HTTP response") {
r.Err = fmt.Errorf("error connecting to API URI: %s. Do you have an http/https mismatch?", c.URL)
} else {
r.Err = err
}
r.Close()
return r
}
Expand Down

0 comments on commit ee67681

Please sign in to comment.