VersionDataLoader.LoadServer doesn't need https://

This commit is contained in:
Dawid Wysokiński 2021-07-13 15:58:21 +02:00
parent 477970b0a6
commit a2e82ef96b
2 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,6 @@
package twdataloader
import (
"fmt"
phpserialize "github.com/Kichiyaki/go-php-serialize"
"github.com/pkg/errors"
"io/ioutil"
@ -41,7 +40,7 @@ func NewVersionDataLoader(cfg *VersionDataLoaderConfig) *VersionDataLoader {
}
func (dl *VersionDataLoader) LoadServers() ([]*Server, error) {
resp, err := dl.client.Get(fmt.Sprintf("https://%s%s", dl.host, EndpointGetServers))
resp, err := dl.client.Get(dl.host + EndpointGetServers)
if err != nil {
return nil, errors.Wrap(err, "couldn't load servers")
}

View File

@ -10,7 +10,7 @@ import (
)
func prepareTestServer(resp string) *httptest.Server {
return httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case EndpointGetServers:
_, err := w.Write([]byte(resp))