Skip to content

Commit ae4a640

Browse files
authored
fix nil pointer issue in headers in esClient lib (#88)
* fix nil pointer issue in headers in esClient lib * update changelog
1 parent 7daa39a commit ae4a640

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- Fix nil pointer when using bearer token for auth ([#88](https://github.com/hasura/ndc-elasticsearch/pull/88))
11+
1012
## [1.9.0]
1113

1214
- Add nested filtering support for nested flattened mappings ([#85](https://github.com/hasura/ndc-elasticsearch/pull/85))

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)