Skip to content

Commit

Permalink
Default to HTTPS everywhere in project
Browse files Browse the repository at this point in the history
  • Loading branch information
thrasher- committed Aug 25, 2017
1 parent 55ea1fe commit 4dcce85
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,28 +435,28 @@ func TestSendHTTPRequest(t *testing.T) {
headers["Content-Type"] = "application/x-www-form-urlencoded"

_, err := SendHTTPRequest(
methodGarbage, "http://query.yahooapis.com/v1/public/yql", headers,
methodGarbage, "https://query.yahooapis.com/v1/public/yql", headers,
strings.NewReader(""),
)
if err == nil {
t.Error("Test failed. ")
}
_, err = SendHTTPRequest(
methodPost, "http://query.yahooapis.com/v1/public/yql", headers,
methodPost, "https://query.yahooapis.com/v1/public/yql", headers,
strings.NewReader(""),
)
if err != nil {
t.Errorf("Test failed. %s ", err)
}
_, err = SendHTTPRequest(
methodGet, "http://query.yahooapis.com/v1/public/yql", headers,
methodGet, "https://query.yahooapis.com/v1/public/yql", headers,
strings.NewReader(""),
)
if err != nil {
t.Errorf("Test failed. %s ", err)
}
_, err = SendHTTPRequest(
methodDelete, "http://query.yahooapis.com/v1/public/yql", headers,
methodDelete, "https://query.yahooapis.com/v1/public/yql", headers,
strings.NewReader(""),
)
if err != nil {
Expand Down Expand Up @@ -524,8 +524,8 @@ func TestJSONEncode(t *testing.T) {
}

func TestEncodeURLValues(t *testing.T) {
urlstring := "http://www.test.com"
expectedOutput := `http://www.test.com?env=TEST%2FDATABASE&format=json&q=SELECT+%2A+from+yahoo.finance.xchange+WHERE+pair+in+%28%22BTC%2CUSD%22%29`
urlstring := "https://www.test.com"
expectedOutput := `https://www.test.com?env=TEST%2FDATABASE&format=json&q=SELECT+%2A+from+yahoo.finance.xchange+WHERE+pair+in+%28%22BTC%2CUSD%22%29`
values := url.Values{}
values.Set("q", fmt.Sprintf(
"SELECT * from yahoo.finance.xchange WHERE pair in (\"%s\")", "BTC,USD"),
Expand Down
2 changes: 1 addition & 1 deletion currency/currency.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type YahooJSONResponse struct {

const (
maxCurrencyPairsPerRequest = 350
yahooYQLURL = "http://query.yahooapis.com/v1/public/yql"
yahooYQLURL = "https://query.yahooapis.com/v1/public/yql?"
yahooDatabase = "store://datatables.org/alltableswithkeys"
// DefaultCurrencies has the default minimum of FIAT values
DefaultCurrencies = "USD,AUD,EUR,CNY"
Expand Down
4 changes: 2 additions & 2 deletions exchanges/huobi/huobi.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (h *HUOBI) GetFee() float64 {

func (h *HUOBI) GetTicker(symbol string) (HuobiTicker, error) {
resp := HuobiTickerResponse{}
path := fmt.Sprintf("http://api.huobi.com/staticmarket/ticker_%s_json.js", symbol)
path := fmt.Sprintf("https://api.huobi.com/staticmarket/ticker_%s_json.js", symbol)
err := common.SendHTTPGetRequest(path, true, &resp)

if err != nil {
Expand All @@ -71,7 +71,7 @@ func (h *HUOBI) GetTicker(symbol string) (HuobiTicker, error) {
}

func (h *HUOBI) GetOrderBook(symbol string) (HuobiOrderbook, error) {
path := fmt.Sprintf("http://api.huobi.com/staticmarket/depth_%s_json.js", symbol)
path := fmt.Sprintf("https://api.huobi.com/staticmarket/depth_%s_json.js", symbol)
resp := HuobiOrderbook{}
err := common.SendHTTPGetRequest(path, true, &resp)
if err != nil {
Expand Down

0 comments on commit 4dcce85

Please sign in to comment.