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:
parent
c222eb9945
commit
a08b1f3458
1 changed files with 2 additions and 1 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue