Skip to content

Commit 6ec5ac5

Browse files
committed
fix nil pointer issue in headers in esClient lib
1 parent 7daa39a commit 6ec5ac5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

elasticsearch/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88
"strconv"
99
"strings"
10+
"net/http"
1011

1112
"github.com/elastic/go-elasticsearch/v8"
1213
"github.com/hasura/ndc-sdk-go/credentials"
@@ -132,7 +133,9 @@ func GetDefaultResultSize() int {
132133
// This function should be used to setup the config with properties
133134
// that will be common across all configs (credentials provieder based configs or env based configs).
134135
func getBaseConfig() (*elasticsearch.Config, error) {
135-
esConfig := elasticsearch.Config{}
136+
esConfig := elasticsearch.Config{
137+
Header: http.Header{},
138+
}
136139

137140
// Read the address
138141
address := os.Getenv(elasticsearchUrlEnvVar)

0 commit comments

Comments
 (0)