1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-07-03 11:53:43 +02:00

src/eosapi/functions.go: in send() u.Host can contain port also. so we need to remove it when setting the Host header.

This commit is contained in:
Henrik Hautakoski 2020-03-20 14:58:59 +01:00
parent c222eb9945
commit a08b1f3458

View file

@ -2,6 +2,7 @@
package eosapi; package eosapi;
import ( import (
"strings"
"time" "time"
"net/url" "net/url"
"io/ioutil" "io/ioutil"
@ -28,7 +29,7 @@ func send(method string, api_url string) (*req.Resp, error) {
// nodeos api does not like that, so we need to provide our // nodeos api does not like that, so we need to provide our
// own Host header with just the host. // own Host header with just the host.
headers := req.Header{ headers := req.Header{
"Host": u.Host, "Host": strings.Split(u.Host, ":")[0],
} }
r := req.New() r := req.New()